php - I am trying to redirect my page through header function but it will not work rather my query is working ...why? -


this index file:

session_start(); include_once 'conn.php'; if(isset($_session['hell'])!="") {     header("location: home.php"); }  if(isset($_post['login'])) {     $email = $_post['email'];     $pass = $_post['pass'];     $res=mysql_query("select * studentreg email='$email'");     $row=mysql_fetch_array($res);      if($row['password']==$pass)     {         $_session['hell']=$row['stu_id'];         header("location: home.php");     }     else     {         echo "hello"."<br/>";         echo $row['password']."<br/>";         echo $row['qualification'];     } } 

this home file:

session_start(); include_once 'conn.php';  if(!isset($_session['hell'])) {     header("location: index.php"); }  $res=mysql_query("select * studentreg stu_id = ".$_session['hell']); $sturow=mysql_fetch_array($res); echo "welcome"; 

it not work rather query working …why?

what error message? add ini_set('display_errors', 1); @ top of page check.

maybe there text printed before header not letting redirect?

are there spaces before php opening tag?

is session variable hell exist page?


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -