problem with the edit the data in form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pavani1
    Banned
    New Member
    • Mar 2008
    • 4

    problem with the edit the data in form

    Hi,

    After signin in my home page one button is there.i,e update profile.for that i wrote the below code but it will not work.plz tell that what's the problem in my code.[php]
    <?php
    // Connect database.
    $host="localhos t"; // Host name.
    $db_user="root" ; // MySQL username.
    $db_password="s reeni"; // MySQL password.
    $database="my_d b1"; // Database name.
    mysql_connect($ host,$db_user,$ db_password);
    mysql_select_db ($database);

    // Select all data records in table "name_list" and put them into $result.
    $result=mysql_q uery("select * from Registered_Memb ers where user_name='$_GE T[user_name]'");
    ?>
    <html><head><ti tle>My Profile</title>
    <link rel=StyleSheet href="style.css " type="text/css" media=screen>
    <style type="text/css">
    #register_panel _a {
    float:left;
    width: auto;
    }
    #register_panel _b {
    float:left;
    width: auto;
    }
    </style></head>
    <body bgcolor=white lang=EN-US link=blue alink=red vlink=purple>
    <div align="center">
    <h1>MY PROFILE</h1>
    <div class="hr_red tiny_top_margin tiny_bottom_mar gin"></div>
    </div>
    <br>
    <?
    // Fetch record rows in $result by while loop and put them into $row.
    while($row=mysq l_fetch_assoc($ result)){
    ?>
    <form><table><t r>
    <td>User Name: </td><td><input class="short_wi dth" type="text" value="<? echo $row['user_name']; ?>" ></td>
    </tr>
    <tr>
    <td>Password: </td><td><input class="short_wi dth" type="text"></td><td>Required to update profile</td>
    </tr><tr>
    <td>New Password: </td><td><input class="short_wi dth" type="text"></td>
    </tr><tr>
    <td>New Password: </td><td><input class="short_wi dth" type="text"></td>
    </tr><tr>
    <td>Private Email: </td><td><input class="short_wi dth" type="text" value="<? echo $row['email']; ?>" ></td><td>Registra tion confirmation, admin. communication.</td>
    </tr><tr>
    <td>Public Email: </td><td><input class="short_wi dth" type="text"></td><td>Public profile display</td>
    </tr><tr>
    <td>First Name: </td><td><input class="short_wi dth" type="text" value="<? echo $row['first_name']; ?>" ></td>
    </tr><tr>
    <td>Last Name: </td><td><input class="short_wi dth" type="text" value="<? echo $row['last_name']; ?>" ></td>
    </tr><tr>
    <td>Gender: </td>
    <td><select name="gender">
    <option value="Unspecif ied">Unspecifie d
    <option value="Male" selected>Male
    <option value="Female"> Female
    </select>
    </td>
    </tr><tr>
    <td>Birth Year: </td><td><input class="short_wi dth" type="text" value="<? echo $row['date_of_birth']; ?>" ></td>
    </tr><tr>
    <td>Web Page: </td><td><input class="short_wi dth" type="text"></td>
    </tr>
    <? } // End while loop. ?>
    </table>
    Personal Statement: <br><textarea rows="5" cols="20">This is my personal statement, blah blah blah...</textarea>
    <div class="floatsto p"></div>
    <input type="submit" value="Update">
    </form></body></html>[/php]
    Last edited by ronverdonk; Apr 2 '08, 02:08 PM. Reason: code tags!!
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Edit you last post, put the code into correct code tags (just above the post content part - same line as bold, italics, etc), and also remove your DB username and password! Replace it with something not real!

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      Originally posted by pavani1
      [HTML]<form>
      <table>
      <tr>[/HTML]
      You're not sending your form anywhere? You should use something like:

      [HTML]<form name="input" action="html_fo rm_action.php" method="post">[/HTML]

      If this was a mistake then let us know, but if you didn't know that, you need to google "html forms" and read up!

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Please enclose your posted code in [code] tags (See How to Ask a Question).

        This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

        Please use [code] tags in future.

        MODERATOR

        Comment

        Working...