$result = fwrite($fp,$shtml); fclose($fp); if( !$result ) { header ("Location: exee.php?mensaje=1"); } else { header ("Location: exee.php?mensaje=0"); }