www.webdeveloper.com
Results 1 to 4 of 4

Thread: Drop DownMenu that displays usrnames in the database then shows selected user details

Hybrid View

  1. #1
    Join Date
    Jul 2013
    Posts
    6

    Exclamation Drop DownMenu that displays usrnames in the database then shows selected user details

    I have made a connection between the drop down menu and the database which shows the current usernames in the rows. I then need to be able to click a box next to the menu that says go and then for it to redirect or refresh to a page with the selected usernames details. I really need your help anyone i have been searching the net for weeks trying to find a solution.

  2. #2
    Join Date
    Jul 2013
    Posts
    351
    What have you tried to write? Give us that and we can add to it perhaps

  3. #3
    Join Date
    Jul 2013
    Posts
    6
    HTML PART:

    <select id="name">
    <?php
    mysql_connect("localhost", "root", "");
    mysql_select_db("login");


    $sql = mysql_query("SELECT * FROM staff");
    while($name = mysql_fetch_object($sql)){
    echo '<option value="'.$name->name.'">'.$name->name.'</option>';
    }
    ?>
    </select>


    <input type="button" value="Go" onclick="showUser()" />

    HEADER PART:

    <script type="text/javascript">
    function showUser(){
    var name = document.getElementById('name').value;
    window.location = '?name='+name;


    }
    </script>

    i am able to put the selected users name in the url but how do i now show just there details?

  4. #4
    Join Date
    Jul 2013
    Posts
    351
    You didnt' say this was an ajax question. Perhaps you should post somewhere else.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles