/    Sign up×
Community /Pin to ProfileBookmark

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 ?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@Strider64Jul 10.2013 — 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.
Copy linkTweet thisAlerts:
@liamster75authorJul 15.2013 — 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?
Copy linkTweet thisAlerts:
@ginerjmJul 15.2013 — 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.

<i>
</i>&lt;ul&gt;
&lt;li&gt;&lt;a href='getdetailspage.php?userid=$userid&gt;$userid&lt;/a&gt;&lt;/li&gt;
....
....
&lt;/ul&gt;
Copy linkTweet thisAlerts:
@liamster75authorJul 16.2013 — okay but how would it know what username details to display on the next page?
Copy linkTweet thisAlerts:
@ginerjmJul 16.2013 — ??

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.
×

Success!

Help @liamster75 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...