I have use this code before when I built a message board for my final project in PHP class, so I KNOW that the code has worked in the past. But it sure doesn't now, and everywhere I turn to gives me the same code or alternate suggestions that don't work.
I'm just trying to do a simple user login and redirection.
$query = "select userid, admin from $SQLtableName where username='$frmUserName'";
$result = mysql_query ($query);
$row = mysql_fetch_array ($result);
$_SESSION['sesLogIn'] = true;
$_SESSION['sesUserID'] = $row[0];
$_SESSION['sesAdmin'] = $row[1];
$_SESSION['sesUserName'] = $usertopass;
//print "<a href=http://www.2kcomm.com/newsite/members/members.php>link</a>";
header("Location:
http://www.2kcomm.com/newsite/members/members.php");
exit();
It should redirect me to my members page, yes? But no, it directs me to the same page I'm on, but now the entire page is blank. That is, unless I take the comments off the '//print' line. Then it will bring up a blank page with the words 'link' on it. But if I press my link, for some reason my members page doesn't get passed the session variables.
I'm so confused, the code is before the HTML. There are no blank lines. My meta refresh is on. It has this problem on both PC and MAC, in IE and Safari. I know that Yahoo! Business Hosting's PHP server accepts HTTP commands, and in fact suggests the exact code I used to redirect users. I can't access the php.ini file, but I don't know if that would do anything even if I could.
If somebody wants to take a whack at it, please help:
http://www.2kcomm.com/newsite/members/login.php
username - marta
password - marta
I'm just getting tired seeing that f**king blank page.
Marta