Page 1 of 1

Pass variable values and database connection to next page

Posted: Sun Jul 20, 2003 10:00 am
by minghua8930
Hi, Guru,

I am new in PHP. I am playing PHP with MySQL and Apache. The problem I have is:

I use FORM to get query parameters entered from Web page. After users click on "submit", they will get the login page. I can get the parameters they entered on this page. But I don't know how to keep those parameters after they login the database.

I can also choose to let them login the database first, then prompt them to enter the parameters. But this way, after they submit, the connection to the database gets lost.

I know that this is simple question and there must be a solution to it. But I could not find it.

Help needed. Thank you in advace.

-MY

Posted: Sun Jul 20, 2003 1:58 pm
by Slippy
Sounds like you need to use sessions.

Sessions will allow you to retain variables across multiple pages.

Read this sticky note: http://www.devnetwork.net/forums/viewtopic.php?t=6521 for more information.

...

Posted: Sun Jul 20, 2003 9:43 pm
by kettle_drum
Yep use either cookies or sessions to store details of the user.

Check out the php site for more info on them.

http://www.php.net/manual/en/function.setcookie.php
http://www.php.net/manual/en/ref.session.php