a powerful variable

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
revbackup
Forum Commoner
Posts: 29
Joined: Tue Jun 09, 2009 1:52 am

a powerful variable

Post by revbackup »

hi,

anyone knows if it's possible to have a variable in which once it is assigned a value,
it would retain the value even if the webpage has refreshed or has moved into another webpage in php?


for example

in saveValues.php, i have a script there that would assign a value to $username to 'me'
$username = 'me';
then, redirect in another page
echo ("<meta http-equiv='Refresh' content='0;url=another.php'>");


Then, i want to use the $username variable in my user.php file, how would i do that or is itpossible???
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: a powerful variable

Post by requinix »

You can use sessions. This "tutorial" looks good.
Post Reply