Uuuhhh...
Example output would be:
Code:
<body alert('You've got mail!');>
That's not valid HTML, and the quotes would break the script even if it were. Not only that, what if s/he wanted to move the file? That's a lot of pages to edit. I'd suggest putting this in a seperate file:
Code:
<?php
$alert = addslashes(file_get_contents('alert.txt'));
if ($alert !== '') $alert = " onload=\"window.alert('$alert');\"";
?>
... then including it:
Code:
<?php require_once('alert.inc.php'); ?>
<body<?php echo($alert); ?>>
@ should never be used. It makes debugging a lot harder -- you have to go through the code removing all those @s to get to the bottom of a problem. If you want to suppress error reporting, do it globally with
Code:
error_reporting(E_NONE);
Bookmarks