This probably a stupid question, but I have a script that I running for about four month that from a guestbook that I made in flash. Then my server upgraded there PHP to 4.3.4
And this where the one with the error is:http://www.socadia.com/guestbook1.swf
Here is the script:
Code: Select all
<?php
<?
if (!isset($name) || !isset($email) || !isset($message) || empty($name) || empty($email) || empty($message)) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Input required for all fields.");
exit;
}
$email = strtolower($email);
addentry($name, $email, $website, $message);
function addentry($name, $email, $website, $message) {
$posted = strftime("%c %h %p");
$message = stripslashes($message);
$filename = "entry.txt";
$fp = fopen( $filename,"r");
$OldData = fread($fp, 80000);
$OldData = preg_replace("/^&result=okay&entries=/", "", $OldData);
fclose($fp);
$Input = "<font color="#FFFFFF">Name:</font> $name\n<font color="#FFFFFF">Email:</font><font color="#FF0000"><A href="mailto:$email"> $email</A></font><br>\n<font color="#FFFFFF">Website:</font><font color="#FF0000"><A href="http://$website"target="_blank"> $website</A></font><br>\n<font color="#FFFFFF">Posted:</font> $posted\n<font color="#FFFFFF">Message:</font> $message\n\n";
$New = "&result=okay&entries=$Input$OldData";
$fp = fopen( $filename,"w");
fwrite($fp, $New);
fclose($fp);
// Send admin an email when new entry occurs
mailAdmin($name, $email, $website, $message);
}
function mailAdmin($name, $email, $website, $message) {
$mailTo = "info@socadia.com";
$mailFrom = "From: <info@socadia.com>";
$mailSubject = "New Guestbook Entry";
$mailBody = "A visitor to your site has left the following information in your guestbook:\n
Name: $name
Email: $email
Website: $website
The visitor commented:
------------------------------
$message
------------------------------
You can view the message at:
http://www.yoursite.com";
mail($mailTo, $mailSubject, $mailBody, $mailFrom);
mail($email, "SOCADIA MUSIC", "Thank you for your guestbook message", "From: SOCADIA MUSIC");
}
print "&result=okay";
exit;
?>
?>