Pass variable values and database connection to next page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
minghua8930
Forum Newbie
Posts: 1
Joined: Sun Jul 20, 2003 10:00 am

Pass variable values and database connection to next page

Post 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
User avatar
Slippy
Forum Contributor
Posts: 113
Joined: Sat Jul 12, 2003 11:31 pm
Location: Vancouver eh!

Post 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.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

...

Post 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
Post Reply