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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variables from Script to Script 1

Status
Not open for further replies.

mwesol

IS-IT--Management
Nov 16, 2000
46
US
PHP Newbie (Bare with me :)

Is there an easy way to pass variables from script to script?

I have a authentication script which queries a database for name and password. I also store in that same database permisson data such as ability to upload. $upload contains what I need but when I do an include to another script the $upload is not passed after the include script finishes.

What is the best way to pass the variable through to the other script?

Thanks
Mike


 
I am assuming you are authenticatibg users ie
enter name & password then chacking against the data in a data base if so then your best bet will be to use this info to create a session. Then write the required info to a session variable which can be checked read by any other php script.

ie

session_start();
$_SESSION[uname] = $_POST[uname];
$_SESSION[upass] = $_POST[upass];

regards
ian

Infinity exists! - I just haven't worked out a way to get there yet.

| |
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top