Results 1 to 3 of 3

Thread: [PHP] How

  1. #1
    Join Date
    Feb 2007
    Location
    West Midlands
    Posts
    1,168
    Tokens
    0
    Habbo
    Jibbish

    Latest Awards:

    Default [PHP] How

    Ok, say like I had a form for editing users. And there is a select drop down menu to select a user to edit. When I select the username, I want the current username to automaticlly filled in, on the new username input box if you get what I mean how do you do it?

    Moved by Hitman (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks.
    Last edited by Hitman; 24-03-2008 at 12:01 AM.

  2. #2
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    dynamically get which is on, if it is on that one echo selected eg something like..

    <select name="x" id="x">
    <option value="olduser" <?php if($user == "old user") { echo " selected "; }>old user</option>
    <option value="olduser" <?php if($user == "new user") { echo " selected "; }>new user</option>
    How could this hapen to meeeeeeeeeeeeeee?lol.

  3. #3
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Reconix View Post
    dynamically get which is on, if it is on that one echo selected eg something like..

    <select name="x" id="x">
    <option value="olduser" <?php if($user == "old user") { echo " selected "; }>old user</option>
    <option value="olduser" <?php if($user == "new user") { echo " selected "; }>new user</option>
    If you're using MySQL use the one below, I grabbed it from housekeeping Version one [Change the database things and config file, or edit it tottaly)

    <?
    echo "<select size='1' name='username_post'>
    <option selected>Choose Your Name</option>";
    include('dbConfig.php');
    $result = mysql_query("SELECT * FROM `staff`");
    while($worked = mysql_fetch_array($result)) {
    $username = $worked["username"];
    echo "<option value=$username>$username</option>";
    }
    mysql_close(); ?>

Posting Permissions

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