Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    dea
    dea is offline
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    update profile not success

    may i post code through here?
    but the code is exceed maximum character length..
    so what can do?

  • #2
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try splitting it up in 2 or 3 posts if you need to

    Jasen

  • #3
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Quote Originally Posted by Jasen Hicks View Post
    Try splitting it up in 2 or 3 posts if you need to

    Jasen
    Actually, don't do that. Instead of posting your entire script and have us comb thru it. Try posting only the relevant parts that are giving you trouble. Your thread isn't very descriptive. You may want to check out the Rules & Posting Guidelines
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #4
    dea
    dea is offline
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <?php
    ob_start();
    session_start();

    require ('config.php');

    print '<h2>Edit My Profile</h2>';

    if (isset($_POST['cancel'])){
    header ('Location: viewProfile.php');
    exit();
    }

    if (isset($_POST['save'])){

    $query="UPDATE member SET
    username='{$_POST['username']}', memb_id='{$_POST['memb_id']}',
    password='{$_POST['password']}',
    phone_no='{$_POST['phone_no']}',
    month='{$_POST['month']}',
    day='{$_POST['day']}',
    year='{$_POST['year']}',
    WHERE memb_id='{$_POST['memb_id']}' ";

    $r=mysql_query($query);

    if(mysql_affected_rows()==1){
    print '<p>Your profile has been updated.</p>';
    }else{
    print '<p>Sorry, your profile could not update now. Please try again later!</p>';
    }

    }else{

    if(is_numeric($_GET['memb_id'])){

    $query="SELECT * FROM member WHERE memb_id={$_GET['memb_id']}";

    if($r=mysql_query($query)){

    $row=mysql_fetch_array($r);

    echo "<form action='editProfile.php' method='POST'>


    <table border=0>
    <tr>
    <td>Username:</td>
    <td><input type='text' name='username' size='20' value=".$row['username']."></td>
    </tr>

    <tr>
    <td>Email Address:</td>
    <td><input type='text' name='memb_id' size='20' value=".$row['memb_id']."></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input type='text' name='password' size='20' value=".$row['password']."></td>
    <td>6 characters or more; capitalization matters!</td>
    </tr>

    <tr>
    <td>Phone Number:</td>
    <td><input type='text' name='phone_no' size='20' value=".$row['phone_no']."></td>
    </tr>


    <tr valign='top'>
    <td>Date of Birth:</td>
    <td><select name='month' >
    <option value=".$row['month'].">".$row['month']."</option>
    <option value='January'>
    January
    </option>
    <option value='February'>
    February
    </option>
    <option value='March'>
    March
    </option>
    <option value=' April'>
    April
    </option>
    <option value='May'>
    May
    </option>
    <option value='June'>
    June
    </option>
    <option value='July'>
    July
    </option>
    <option value='August'>
    August
    </option>
    <option value='September'>
    September
    </option>
    <option value='October'>
    October
    </option>
    <option value='November'>
    November
    </option>
    <option value='December'>
    December
    </option></select>

    <select name='day' >
    <option value=".$row['day'].">".$row['day']."</option>
    <option value='1'>
    1
    </option>
    <option value='2'>
    2
    </option>
    <option value='3'>
    3
    </option>
    <option value='4'>
    4
    </option>
    <option value='5'>
    5
    </option>
    <option value='6'>
    6
    </option>
    <option value='7'>
    7
    </option>
    <option value='8'>
    8
    </option>
    <option value='9'>
    9
    </option>
    <option value='10'>
    10
    </option>
    <option value='11'>
    11
    </option>
    <option value='12'>
    12
    </option>
    <option value='13'>
    13
    </option>
    <option value='14'>
    14
    </option>
    <option value='15'>
    15
    </option>
    <option value='16'>
    16
    </option>
    <option value='17'>
    17
    </option>
    <option value='18'>
    18
    </option>
    <option value='19'>
    19
    </option>
    <option value='20'>
    20
    </option>
    <option value='21'>
    21
    </option>
    <option value='22'>
    22
    </option>
    <option value='23'>
    23
    </option>
    <option value='24'>
    24
    </option>
    <option value='25'>
    25
    </option>
    <option value='26'>
    26
    </option>
    <option value='27'>
    27
    </option>
    <option value='28'>
    28
    </option>
    <option value='29'>
    29
    </option>
    <option value='30'>
    30
    </option>
    <option value='31'>
    31
    </option></select>

    <select name='year' >
    <option value=".$row['year'].">".$row['year']."</option>
    <option value='2004'>
    2004
    </option>
    <option value='2003'>
    2003
    </option>
    <option value='2002'>
    2002
    </option>
    <option value='2001'>
    2001
    </option>
    <option value='2000'>
    2000
    </option>
    <option value='1999'>
    1999
    </option>
    <option value='1998'>
    1998
    </option>
    <option value='1997'>
    1997
    </option>
    <option value='1996'>
    1996
    </option>
    <option value='1995'>
    1995
    </option>
    <option value='1994'>
    1994
    </option>
    <option value='1993'>
    1993
    </option>
    <option value='1992'>
    1992
    </option>
    <option value='1991'>
    1991
    </option>
    <option value='1990'>
    1990
    </option>
    <option value='1989'>
    1989
    </option>
    <option value='1988'>
    1988
    </option>
    <option value='1987'>
    1987
    </option>
    <option value='1986'>
    1986
    </option>
    <option value='1985'>
    1985
    </option>
    <option value='1984'>
    1984
    </option>
    <option value='1983'>
    1983
    </option>
    <option value='1982'>
    1982
    </option>
    <option value='1981'>
    1981
    </option>
    <option value='1980'>
    1980
    </option>
    <option value='1979'>
    1979
    </option>
    <option value='1978'>
    1978</option>
    </select>
    </td>
    </tr>

    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td valign='top'> <div align='left'>
    <input type='hidden' name='memb_id' value=".$_GET['memb_id'].">
    <input type='submit' name='save' value='Save'>
    <input type='submit' name='cancel' value='Cancel'>

    </div></td>
    </tr></form>
    </table>";

    }else{
    print 'Could not retrieve the record because:<b>'.mysql_error().'</b>. </p>';
    }

    }else{
    print'<p><b>You must have made a mistake in using this page.</b></p>';
    }
    }
    ?>

  • #5
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Quote Originally Posted by StupidRalph View Post
    Actually, don't do that. Instead of posting your entire script and have us comb thru it. Try posting only the relevant parts that are giving you trouble. Your thread isn't very descriptive. You may want to check out the Rules & Posting Guidelines
    Please refer to the posting rules and guidelines. You should wrap all of your php code with the PHP tags by clicking the little PHP Icon in the posting textbox. Also, you did not describe your problem. I doubt you will receive any additional replies until you correct this.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #6
    dea
    dea is offline
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •