truegilly Posted March 2, 2007 Share Posted March 2, 2007 Hi everybody, ive got a problem thats really confusing me. ??? I have developed a PHP web site that i have been testing using local servers (apache & MYSQL) and everything works fine. I have spend most of the day copying create table scripts into my online MYSQL server and ironing out the SQL case sensitivity bugs that cause my Linux server to throw a white screen. anyway, i have a page that users headers which works fine when tested using local servers but when uploaded to my linux server i get a white screen. Im 99.9% sure its the headers thats causing the problem and would be very grateful for any help. heres my code..... <?php require("sapphire_web_dbConnect.php"); $RiskID = $_GET['RiskID']; $RiskID = $RiskID - 1; //echo $RiskID; //perform query $query = "SELECT MIN(VC10_Risk_Id) FROM vc10_risk"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // get a single row from the database $row = mysql_fetch_row($result); $minNo = $row[0]; if($RiskID >= $minNo){ @header("location: Risk_display.php?prevVal=$RiskID"); } else if($RiskID < $minNo){ @header("location: Risk_display.php?prevVal=$minNo"); } ?> the code above is the result of a user clicking the previous button on a PHP page that takes the value in $_GET['RiskID'], decrements it and returns the that page. Thanks in advance !! Truegilly Link to comment https://forums.phpfreaks.com/topic/40873-white-screen-from-linux-server-when-using-headers/ Share on other sites More sharing options...
redarrow Posted March 2, 2007 Share Posted March 2, 2007 <?php ob_start(); require("sapphire_web_dbConnect.php"); $RiskID = $_GET['RiskID']; $RiskID = $RiskID - 1; //echo $RiskID; //perform query $query = "SELECT MIN(VC10_Risk_Id) FROM vc10_risk"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // get a single row from the database $row = mysql_fetch_row($result); $minNo = $row[0]; if($RiskID >= $minNo){ @header("location: Risk_display.php?prevVal=$RiskID"); } else if($RiskID < $minNo){ @header("location: Risk_display.php?prevVal=$minNo"); } ob_end_flush(); ?> Try this but remember ob function is not always the ansaw but as your stopping the error @ anyway do this way ok. Link to comment https://forums.phpfreaks.com/topic/40873-white-screen-from-linux-server-when-using-headers/#findComment-197923 Share on other sites More sharing options...
truegilly Posted March 2, 2007 Author Share Posted March 2, 2007 It worked !! u da Man redarrow !! i tried it with the @'s in place and was getting the white screen so i tried it without and it worked ! thank you Truegilly Link to comment https://forums.phpfreaks.com/topic/40873-white-screen-from-linux-server-when-using-headers/#findComment-197935 Share on other sites More sharing options...
redarrow Posted March 2, 2007 Share Posted March 2, 2007 Your welcome. Link to comment https://forums.phpfreaks.com/topic/40873-white-screen-from-linux-server-when-using-headers/#findComment-197939 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.