Page 1 of 1
Authentication form that sends username to next page
Posted: Sat Dec 06, 2003 7:59 pm
by snow4cast
I need some quick help on a Login page. It should send the username the next page, where it will pull and display the MySQL database information based on login name.
I also need them to populate fields.
Any help is greatly appreciated.
Thank you.
Posted: Sat Dec 06, 2003 8:24 pm
by Pyrite
If you're calling the next page with a form, then on the next page the username would be in the $_POST['username'].
Or, if you're calling the next page with a URL (page.php?user=username), then on the next page you would access it with $_GET['user']
Understand?
Posted: Sat Dec 06, 2003 9:20 pm
by snow4cast
First of all, thank you for your quick response.
The second page I got under control. It's the process of using one one submit button to both check login info, and second, send the information to the second page, probably in a URL push.
Would I need two form actions, and if so, how is the syntax constructed for that?
Posted: Sat Dec 06, 2003 11:25 pm
by Pyrite
Nah, Just do this. If you form action is post, then name the submit button like name="btnSubmit" or something. Then at the beginning of the first page..
if ($_POST['btnSubmit']) {
// Check Login Stuff
// Call the second page passing the stuff by URL push.
}
Posted: Sun Dec 07, 2003 12:44 am
by Chambrln
You could also create a session variable to hold the username and not pass it via forms.