gammaman Posted May 1, 2008 Share Posted May 1, 2008 what am I missing, the page loads blank, which it should anyway, but it does not redirect to either page. <?php session_start(); $Conn=mysql_connect("localhost","fierm","13183"); if(!$Conn){ echo "failed"; } else{ $user=$_POST['user']; $pass=$_POST['pass']; mysql_select_db("fierm"); $result=mysql_query("select studentID, password FROM Student WHERE studentID='$user' and password='$pass'"); if(mysql_num_rows($result)==1){ $_SESSION['allowed']=1; header('location:student.php'); } else{ //echo "Invalid Password, Return To Login"; $_SESSION['allowed']=0; header('location:studentlog.php'); } } ?> <html> <body> </body> </html> Link to comment https://forums.phpfreaks.com/topic/103704-help-error-on-page/ Share on other sites More sharing options...
gammaman Posted May 1, 2008 Author Share Posted May 1, 2008 I got that part working and it now redirects to the proper page. When it redirects to the next page, how do I make the the sessions available. Link to comment https://forums.phpfreaks.com/topic/103704-help-error-on-page/#findComment-530954 Share on other sites More sharing options...
mescal Posted May 1, 2008 Share Posted May 1, 2008 session_start(); on top of the needed pages Link to comment https://forums.phpfreaks.com/topic/103704-help-error-on-page/#findComment-530959 Share on other sites More sharing options...
gammaman Posted May 1, 2008 Author Share Posted May 1, 2008 Yes I realize that but how do I make the $user=$_POST['user'] from the first page avialable to the page it redirects to? Link to comment https://forums.phpfreaks.com/topic/103704-help-error-on-page/#findComment-530962 Share on other sites More sharing options...
gammaman Posted May 1, 2008 Author Share Posted May 1, 2008 I figured that out too but it is really correct to query a SESSION variable? I mean I am not doing a major site here, it is just for a project. I heard that using session vars in a query can leave your web application open to rouge queries by an attacker. Link to comment https://forums.phpfreaks.com/topic/103704-help-error-on-page/#findComment-530963 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.