views:

20

answers:

1

I have an issue. When I run:

try {
 $as
  ->setForename($_POST['fname'])
  ->setSurname($_POST['sname'])
  ->setEmail($_POST['email'])
  ->setUser($_POST['user'])
  ->setPass($_POST['pw'])
  ->setPhone($_POST['tel'])
  ->setMobile($_POST['mob'])
  ->setJob($_POST['job'])
  ->setAuth($_POST['auth'])
  ->addProcess();
}
catch (Exception $e) {
 echo $e;
}

I get "white screen of death" however when I use:

$as
 ->setForename($_POST['fname'])
 ->setSurname($_POST['sname'])
 ->setEmail($_POST['email'])
 ->setUser($_POST['user'])
 ->setPass($_POST['pw'])
 ->setPhone($_POST['tel'])
 ->setMobile($_POST['mob'])
 ->setJob($_POST['job'])
 ->setAuth($_POST['auth'])
 ->addProcess();

It all works fine. I am really confused please help, thanks in advance.

+1  A: 

The try-catch block seems to be fine, try putting these lines on top of your script to see the possible error:

ini_set('display_errors', true);
error_reporting(E_ALL);
Sarfraz
@sAc:I have:error_reporting(E_ALL);ini_set("display_startup_errors",1);ini_set("display_errors",1);As an included header.
Kyle Hudson
Its working again now, we havent changed any code! A weird one.
Kyle Hudson
Wrikken
@Wrikken:Setting any ini vars in .htaccess caused http 500 internal server errors in the past.
Kyle Hudson
@Kyle Hudson: If it runs fine sometimes and not at other times then most surely it is not syntax error. It is some other issue, probably with server.
Sarfraz
@sAc:Quite possibly the server, should be migrating to a new one soon, will see if the error returns.Thanks to everyone for their insight :D
Kyle Hudson