Posted by:
stevenmartin99
(---.b-ras2.blp.dublin.eircom.net)
tricky situation. no both shud work.. becasue php doesnt output until the page is completely parsed so nothing has been sent to the broswer until the page is parsed..
for a failed example use
Whitespace before the opening php tag
---------------------------------------
<?php
if($x = 1) {
header('Location: pagex.php');
}
else {
header('Location: pagey.php');
}
?>
----------------------------------------
or
Some html code before php
---------------------------------------
<html>
some html code first
<?php
if($x = 1) {
header('Location: pagex.php');
}
else {
header('Location: pagey.php');
}
?>
----------------------------------------
these will both fail on both systems.
the problem your seeing with it working on localhost but not on host is most likely due to a php setting called
outputbuffering
this determines when to send data to the browser. and how often and how much.
You will need to find out how output buffering is set on your host and then
left click wamp icon> php> php.ini and set it as theirs is..
One thing u cud do is to left click wamp icon>php>setting> outputbuffering
See if this makes it act the same as your host.. but really you shold check all their settings for it , not just is it on or off
Steven Martin
stevenmartin99@gmail.comstevenmartin99@hotmail.comPampServer.com - [
pampserver.com]
Edited 1 time(s). Last edit at 02/04/2010 10:03AM by stevenmartin99.