Posted: Sun Feb 01, 2004 9:52 pm
Http://www.THeNetherRealm.com/shoutbox.php go there try WWWWWWWWWWWWWWWW then try typing in a sentance
and this is switch.php basicly does everything before it posts....
and this is switch.php basicly does everything before it posts....
Code: Select all
<?php
// Deleates any old errors to keep from a back up.
$HTTP_REFERER2 = str_replace("?error=1", "", $HTTP_REFERER);
$hover_info = date("g:i A | F j, Y");
$shouts_data = "inc/shouts.inc";
$shout_post_theme = file_get_contents("inc/post_theme.inc");
$shout_old_data = file_get_contents("inc/shouts.inc");
if(isset($_POST['1'])) {
if(strtolower($shout_data1) == "name" || strtolower($shout_data2) == "message") {
Header("Location: $HTTP_REFERER2?error=1");
} Else {
// Get's rid of that \ evertime someone types a special charactor.
$shout_data1 = str_replace("", "", $shout_data1);
$shout_data2 = str_replace("", "", $shout_data2);
// Stip HTML tags.
$shout_data1 = strip_tags(trim($shout_data1));
$shout_data2 = strip_tags(trim($shout_data2));
// Automaticly break long lines.
$shout_data1 = wordwrap($shout_data1, 15, "<br />",1);
$shout_data2 = wordwrap($shout_data2, 15, "<br />",1);
// Checks for a URL & if it's there it add's it if not it doesn't.
if($link == "") {
$shout_data1 = "<span title='$hover_info'>$shout_data1</span>";
} Else {
$shout_data1 = "<span title='$hover_info'><a href='$link' target='_blank'>$shout_data1</a></span>";
}
// Get's code checkers.
include("inc/censor_check.inc");
include("inc/smilie_check.inc");
// Add's new shout
$fp = fopen( $shouts_data, "w" ) or die("We are sorry, We couldn't add the shout!");
fwrite( $fp, "<table cellpadding='2' cellspacing='0' border='0' width='150' align='center'>
<tr>
<td width='150'>
<b><font size='2' color='#DDDDDD'>$shout_data1</font></b>
</td>
</tr>
<tr width='150'>
<td><font size='2'>$shout_data2</font></td>
</tr>
</table>
<hr color='#000000' width='100%' size='1'>
$shout_old_data" );
fclose( $fp );
Header("Location: $HTTP_REFERER2");
}
} Else {
Header("Location: $HTTP_REFERER2");
}
?>