I can find hundreds of examples of "insert into header location", but I have not found any exaples where the $variable = header location.
Is this possible:
$error=header('Location: http://www.example.com/error.php');
Basicly I had 3 conditions if row not found in mysql.
So I set up the 3 conditions:
if condition1 $error="a statement"
if condition2 $error="SELECT data FROM table WHERE data= 'default'";
if condition3 $error=header('Location: example.com/error.php');
and then if($result->num_rows =0) $error
In my case $error could be 3 different things, one of them being "redirect to the error page" but $error=header('Location:blah'); causes 500 server error.
I altered my code so that I could use header location in the conventional manner, but would still like to know if $var = header location is possible.
The original code that prompted the question has been overwritten, I no longer have it to post.
Thanks Tom