Function fopen error

Im having some problems with a PHP guestbook, something with fopen. When i try to write a message, i get the following error message(see attached file)
This is the php code on post.php:

// Name and Message required
if (( $name == "") || ( $message == "")) {
print "<p align=center>Preencha todos os campos!<p>";
else {
//Get the file
$file_name = "post.xml";
$file_pointer = fopen($file_name, "r+");
$lock = flock($file_pointer, LOCK_EX);
$file_read = fread($file_pointer, filesize($file_name));
$name = strip_tags($name, '');
$message = strip_tags($message, '');
$date = date ("j M Y");
$post = "

<p><span class=name>$name</span><span class=date> $date</span><br>$message</p>
//Paste the updated info into the file
$post = stripslashes($post);
fwrite($file_pointer, "$post");
print "<head><meta http-equiv=refresh content=0;URL=index.php></head>";

Can anyone help me solve this problem? :cyclops: