Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carrying login auth for several pages

Status
Not open for further replies.

lhs24

Technical User
Aug 15, 2000
6
US
I want to have a user login into a page and then perform some data input and update some files and get a report back.
I have everything figured out except the way to keep the database user login the same until the process is complete (I use the user as part of the data submitted).

Will pconnect or can I carry the login through the pages and use to login each time?

If carry through, how do I pass the variables? I have tried this method and have not been sucessful.

I am using mysql as the database on an Apache server.
 
Use session variables.
I am assuming the user is entering their username in a form and that that name is used to login to the database. If so, put this in your form handler:

session_start();
session_register('user');
$user = $user_passed_in;

And on any subsequent pages where you need to connect with the same username, use:

session_start();
session_register('user');

and $user will have the same value they entered into the login form. Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
Thanks, bardley

Yes, that's what I am doing. Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top