Page 1 of 1

How can I move a variable from one script to another?

Posted: Sat Jul 12, 2003 7:18 pm
by jelco
Hi,
I need to move or copy variables from one script to another and they need to keep the info that they hold, is there any way of doing this?

The way I have my site setup is you login and you go to one of three pages (depending on your info in the db), then you have links to all these other places. You go to one of the places and then fill out a form lets say and then I need to have a link to bring the person back to their original page (one of the three i described earlier). The only way I can think of doing this is by moving or copying variables. Any help is appriciated!

A Few Solutions For You

Posted: Sat Jul 12, 2003 8:11 pm
by Brian
If your user is still logged in, you could easily check your database as you do when your user first logs in. That might be the fastest and easiest thing for you to implement since you are doing it already. You could also use PHP's built-in session handling functions to keep track of as many variables as you like. If you want to avoid server overhead from database queries and session variable loading and saving, you could store some basic information in an HTTP cookie.

You might also find this helpful.

Posted: Sat Jul 12, 2003 8:14 pm
by Brian

Posted: Sat Jul 12, 2003 8:16 pm
by jelco
I wasn't think when I posted, they come from the page to another page that only people with that info can get to so all i have to do is add a link back to the first page because people with diffrent people can't get to that page. And I'm not using a hard login script, it just scans the db for the username and password and if its there lets you in so I don't know how I could do it a diffrent way but thankz for your help!