Link to home
Start Free TrialLog in
Avatar of MICHAEL HOGGATT
MICHAEL HOGGATT

asked on

error reporting

I need to set PHP to write to a file.
When I run this code -

    <?php
error_reporting(E_ALL);ini_set('display_errors', 1);
$myfile = fopen("newfile.txt", "w") ordie("Unable to open file!");
$txt = "John Doe\n";
$txt = "Jane Doe\n";
echo "PHP worked ?";
fclose($myfile);
?>

there are no error messages in FireFox, just a blank screen.
there is a 500 server error in Internet Explorer.

Is there something wrong or the placement of the error_reporting code?
PHP is running properly through the server other than I'm sure there are errors trying to write to the file.

Thanks,

Michael
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial