www.webdeveloper.com
Results 1 to 6 of 6

Thread: Username selected in drop down menu then redirect to new page with the users details

  1. #1
    Join Date
    Jul 2013
    Posts
    6

    Post Username selected in drop down menu then redirect to new page with the users details

    hi, im working on a website and i have made a connection between a drop down menu and my database. so far it displays the current usernames on the database, but when i click it and click the go button i want it to redirect to a new page with the selected users details. is this possible?

    thanks

  2. #2
    Join Date
    Feb 2013
    Posts
    64
    I'm assuming you have an unique id for each user? Just use that id as part of the new page in order to show that particular user's details.

  3. #3
    Join Date
    Jul 2013
    Posts
    6
    yes each user has an user_id and username. how would i do this? i dont quite understand how to get the id and then get the information?

  4. #4
    Join Date
    Jul 2013
    Posts
    350
    What you click on could be setup as an anchor tag wherein your href points to a script that takes the GET parm from the anchor and uses it to do a query of your database again (you did it once in order to display the dropdown, right?) and gather all the user's details, then create a new web page to send back.

    Code:
    <ul>
    <li><a href='getdetailspage.php?userid=$userid>$userid</a></li>
    ....
    ....
    </ul>

  5. #5
    Join Date
    Jul 2013
    Posts
    6
    okay but how would it know what username details to display on the next page?

  6. #6
    Join Date
    Jul 2013
    Posts
    350
    ??
    You take the userid that comes in on the url and run with it. Or if userid is not enough, add more args to the url so that you can get what you need.

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