PHP newbie question
Posted: Tue Dec 09, 2003 1:22 am
Hi, I am a newbie to PHP (trying to teach myself) and I apologise in advance for what may seem like a dumb question. I am having trouble getting my code working after authorisation is successful. what i am trying to do is to get my test.php file to call/display another php file from the success block of code. here is the code if it helps
here is where I have the problem I have used this script in the double quotes as it is the only one I have found so far but it gives me a directory listing and wont let me go to another php page
I am confused a bit as I have only just started to teach myself PHP and I don't have any programming experience.
Thanks,
concatenate_man
Code: Select all
<?php
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$connection = @mysql_connect(****,****,****);
$db = @mysql_select_db(*****, $connection);
$sql = "SELECT * FROM members WHERE username = '$username'";
$result = mysql_query ($sql);
$row = mysql_fetch_array($result);
$usercheck = $rowї"username"];
$passcheck = $rowї"password"];
if ($passcheck == $password and $usercheck == $username and $username != ""):
$_SESSIONї'authenticated'] = "yes";
$_SESSIONї'error'] = "no";Code: Select all
"header("Location: http://".$_SERVERї'HTTP_HOST'].dirname($_SERVERї'PHP_SELF'])."/". $_SESSIONї"sourcepage"]); "
else:
echo ("You do not have authorization to enter. Please contact admin to register.");
endif;
?>Thanks,
concatenate_man