Jump to content

white screen from Linux server when using headers.


truegilly

Recommended Posts

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  :-*

 

<?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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.