Re: echo or print question (maybe)?
| From: | RT | Date: | Thu, 10 Apr 2003 03:01:13 +0000 |
| Subject: | Re: echo or print question (maybe)? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19379@lists.php.net to get a copy of this message | ||
You can't store a header location function within a variable. It just becomes a string. Not a function.
Try:
if(!@mysql_select_db($databasename)) { This is part of an include in file
'A'.
$message['server'] = $d_base_error;
header(location: step2.php);
exit;
}
ODCS wrote:
This is probably simple, but I have a real brain cramp today. I have the code below - if there is an error connecting to the database I am setting an error message and then trying to get the script to return to step2.php. Right now all it does is display the contents of $redirect - how do I get it to actually execute header(location: step2.php); instead of just displaying the content? $redirect = "header(location: step2.php)"; This gets set in file 'A'. if(!@mysql_select_db($databasename)) { This is part of an include in file 'A'. $message['server'] = $d_base_error; echo "$redirect"; exit; }