benireland
Technical User
Ok I'm pretty much a novice to this! I installed the latest Apache, PHP and MYSQL to my PC running XP. I have been happily learning PHP/SQL from a fat book for several months and have learnt alot. Initial I didn't know how and then didn't get round to turning global_variables to 'on' in the c:\php\php.ini file. (To pass variable page-to-page I have been using: $_GET['var_name']).
Today I saved the file with this as 'on' but even afte a OS reset it hasn't made a difference that i've noticed w.r.t. collecting post/get form variables.
Now I am learning to use session variables. Which seem pretty straight forward but after I have set a login session variable (to allow personalised page content) my pages just won't detect the session variable even though I pulled the code out of a book.
I'd really appreciate it if someone could point out my error or at least a way I can narrow down the possible promlem. Here's the code;-
//////// extranct from login.php
{after I have valid dated the entered login details}...
if (session_is_registered("valid_user"
){
echo "you are now logged in as: $valid_user <br>";
echo "<a href=\"logout.php\"> Log out </a> <br>";
}
<a href="cal_front.php"> Members section </a>
... {At this stage the session variable is the correct value and this if proved in the echoed text. Then if we look at the file it links to;
//////// extracts from cal_front.php
<?
session_start();
if (session_is_registered("valid_user"
){
echo "A valid_user value is found in sess vars <br>";
}
else{
echo "Warning: No valid_user in the sess vars <br> ";
}
...{ but this time on a new page it doesn't detect this sess var.}
Can anyone help a desparate guy???? My wild guesses might be to do with the way I set (or rather did not set up) the server completely. Although just about everything else has worked.
Thanks very much
Today I saved the file with this as 'on' but even afte a OS reset it hasn't made a difference that i've noticed w.r.t. collecting post/get form variables.
Now I am learning to use session variables. Which seem pretty straight forward but after I have set a login session variable (to allow personalised page content) my pages just won't detect the session variable even though I pulled the code out of a book.
I'd really appreciate it if someone could point out my error or at least a way I can narrow down the possible promlem. Here's the code;-
//////// extranct from login.php
{after I have valid dated the entered login details}...
if (session_is_registered("valid_user"

echo "you are now logged in as: $valid_user <br>";
echo "<a href=\"logout.php\"> Log out </a> <br>";
}
<a href="cal_front.php"> Members section </a>
... {At this stage the session variable is the correct value and this if proved in the echoed text. Then if we look at the file it links to;
//////// extracts from cal_front.php
<?
session_start();
if (session_is_registered("valid_user"

echo "A valid_user value is found in sess vars <br>";
}
else{
echo "Warning: No valid_user in the sess vars <br> ";
}
...{ but this time on a new page it doesn't detect this sess var.}
Can anyone help a desparate guy???? My wild guesses might be to do with the way I set (or rather did not set up) the server completely. Although just about everything else has worked.
Thanks very much