After replacing your addtag.php with the above code, Clear up everything which is in content.txt and let me know.PHP Code:<?php
// This gets the information from the form
$name = $_POST['name'];
$website = $_POST['website'];
$message = $_POST['message'];
// This takes the smiley code in the message and turns it into a smiley
$code = array(
'/:\)/',
'/:P/',
'/:D/'
);
$image = array(
'<img src="smileys/smile.gif">',
'<img src="smileys/razz.gif">',
'<img src="smileys/biggrin.gif">'
);
$formatted = preg_replace($code, $image, $message);
if(empty($name) OR empty($website) OR empty($message))
{
echo "Please fill it out the name,website or message field.";
}
else
{
// Set up how it's going to be displayed.
$tag = ("<font size=\"2\" face=\"Arial\">
<a href=\"htmlspecialchars($website);\" target=\"_blank\">htmlspecialchars($name)</a>: htmlspecialchars($formatted);
</font><br>");
// Gather the data currently in the file
$read = fopen("content.txt", "r");
$contents = fread($read, filesize('content.txt'));
fclose($read);
// Open the file and write the tag to it
$write = fopen("content.txt", "w");
fwrite($write, "$tag $contents");
fclose($write);
}
// Refresh!
print "<meta http-equiv=\"refresh\" content=\"0;shoutbox.php\">";
?>
Please remove any refresh html codes which I told you before because the refresh code is intergated in the above code.






Reply With Quote


