Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Plz help ASAP

Links for php scripts

Moderators: macek, egami, gesf

Plz help ASAP

Postby Tim » Mon Mar 31, 2003 8:35 pm

I am having problems with my shoutbox and my guestbook. I had instructions on how to fix my problem, but the site that had my instructions was shut down. My guestbook and shoutbox can be seen but nothing can not be posted to either of them. I think there is something else in the php.ini i need to change but I can't remember what. Plz help ASAP.
Tim
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Mar 31, 2003 8:31 pm

Postby daemon80 » Fri Apr 11, 2003 1:27 pm

Show us the code if you want any help.
daemon80
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Apr 11, 2003 1:00 pm

Postby Tim » Sun Apr 13, 2003 11:44 am

well here is the code, but i do not believe the code is the problem

<?php

#############################
#
# sBOX v2.0
#
# coded: kai
# email: kai@endity.com
# site: http://endity.com
#
#############################

//--------------------------------------------------------------------------- Start Vars

// Place your settings between the two speach marks like the examples

// Enter your Username and Password

$username = "admin";
$password = "pass";

// Time Adjust (enter 12 to -12 to alter the time displayed under the posters name)

$time_a = "0";

// Max Characters allowed to be posted in the message field

$max_char = "100";

// Swear filter

$word1 = "fuck";
$censor1 = "f**k";
$word2 = "shit";
$censor2 = "s**t";
$word3 = "bastard";
$censor3 = "b*****d";
$word4 = "ass";
$censor4 = "a$$";

// Scroll (Yes or No)

$scroll = "yes";

//-----------DO NOT EDIT BELOW THIS LINE---------------------------

//--------------------------------------------------------------------------- End Vars

if ($act==add) {

//--------------------------------------------------------------------------- Start Add

setcookie("user_name", "$name", time()+172800);
setcookie("user_site", "$site", time()+172800);

$name = strip_tags($name,"");

if ($site == "http://") {
$name_link = "$name";
} elseif ($site == "") {
$name_link = "$name";
} else {
$name_link = "<a href=\"$site\" target=\"_blank\">$name</a>";

}

if ($name == "name") {
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?message=Enter+Name&info2=$info&site2=$site\">";
} elseif ($name == "") {
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?message=Enter+Name&info2=$info&site2=$site\">";
} elseif (strstr($name, "#")) {
$user = explode("#", $name);
if ($user[0] == "$username" && $user[1] == "$password") {
$newname = "$user[0]";
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?act=adda&info=$info&site=$site&name=$newname\">";
} else {
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?message=Wrong User/Pass&name2=$name&site2=$site&info2=$info\">";
}
} elseif ($info == "") {
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?message=Enter+Message&name2=$name&site2=$site\">";
} elseif ($info == "message") {
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?message=Enter+Message&name2=$name&site2=$site\">";
} elseif (strlen($info)>$max_char) {
print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php?message=Max+Characters+($max_char)&name2=$name&site2=$site\">";
} else {

$file = "data.dat";

//----------------------- Start Bcode


$info = strip_tags($info,"");
$info = str_replace(":)","<img src='smilies/smile.gif'>",$info);
$info = str_replace(":(","<img src='smilies/sad.gif'>",$info);
$info = str_replace(":P","<img src='smilies/bigrazz.gif'>",$info);
$info = str_replace(":D","<img src='smilies/biggrin.gif'>",$info);
$info = str_replace("8)","<img src='smilies/cool.gif'>",$info);
$info = str_replace(":@","<img src='smilies/mad.gif'>",$info);
$info = str_replace(";)","<img src='smilies/wink.gif'>",$info);
$info = str_replace("???","<img src='smilies/confused.gif'>",$info);
$info = str_replace("[url]","[<a href=\"",$info);
$info = str_replace("[/url]","\" target=\"_blank\">www</a>]",$info);
$info = str_replace("[mail]","[<a href=\"mailto:",$info);
$info = str_replace("[/mail]","\">@</a>]",$info);
$info = str_replace("$word1","$censor1",$info);
$info = str_replace("$word2","$censor2",$info);
$info = str_replace("$word3","$censor3",$info);
$info = str_replace("$word4","$censor4",$info);
$info = stripslashes($info);
$name = stripslashes($name);
$name_link = stripslashes($name_link);

//----------------------- End Bcode

//----------------------- Start Add Content

$date = date("G:i", time());

$date_array = explode("-", $date);

$new = $date_array[0] + $time_a;

$daten = date("m/d @ $new:i", time());

print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php\">";

$fp = fopen ($file, "r+") or die ("error when opening $file");
flock($fp,2);
$old=fread($fp, filesize($file));
rewind($fp);
fwrite ($fp, "<span title=\"Posted: $daten\"><b>$name_link</b> : $info</span>\n".$old);
flock($fp,3);
fclose ($fp);

//----------------------- End Add Content

}

//--------------------------------------------------------------------------- End Add

} elseif ($act==adda) {

//--------------------------------------------------------------------------- Start Add Admin

setcookie("user_name", "$name", time()+172800);
setcookie("user_site", "$site", time()+172800);

$name = strip_tags($name,"");
$name = str_replace("","<i>",$name);
$name = str_replace("
","</i>",$name);

if ($site == "http://") {
$name_link = "$name";
} elseif ($site == "") {
$name_link = "$name";
} else {
$name_link = "<a href=\"$site\" target=\"_blank\">$name</a>";
}

$file = "data.dat";

//----------------------- Start Bcode

$info = wordwrap($info, 8, " ", 1);
$info = strip_tags($info,"");
$info = str_replace(":)","<img src='smilies/smile.gif'>",$info);
$info = str_replace(":(","<img src='smilies/sad.gif'>",$info);
$info = str_replace(":P","<img src='smilies/bigrazz.gif'>",$info);
$info = str_replace(":D","<img src='smilies/biggrin.gif'>",$info);
$info = str_replace("8)","<img src='smilies/cool.gif'>",$info);
$info = str_replace(":@","<img src='smilies/mad.gif'>",$info);
$info = str_replace(";)","<img src='smilies/wink.gif'>",$info);
$info = str_replace("???","<img src='smilies/confused.gif'>",$info);
$info = str_replace("[url]","[<a href=\"",$info);
$info = str_replace("[/url]","\" target=\"_blank\">www</a>]",$info);
$info = str_replace("[mail]","[<a href=\"mailto:",$info);
$info = str_replace("[/mail]","\">@</a>]",$info);
$info = str_replace("$word1","$censor1",$info);
$info = str_replace("$word2","$censor2",$info);
$info = str_replace("$word3","$censor3",$info);
$info = str_replace("$word4","$censor4",$info);
$info = stripslashes($info);
$name = stripslashes($name);
$name_link = stripslashes($name_link);

//----------------------- End Bcode

//----------------------- Start Add Content

$date = date("G:i", time());

$date_array = explode("-", $date);

$new = $date_array[0] + $time_a;

$daten = date("m/d @ $new:i", time());

print "<meta http-equiv=\"refresh\" content=\"0; URL=sBOX.php\">";

$fp = fopen ($file, "r+") or die ("error when opening $file");
flock($fp,2);
$old=fread($fp, filesize($file));
rewind($fp);
fwrite ($fp, "<span title=\"Posted: $daten\"><b>$name_link</b> : $info</span>\n".$old);
flock($fp,3);
fclose ($fp);

//----------------------- End Add Content

//--------------------------------------------------------------------------- End Add Admin

} elseif ($act==all) {

//--------------------------------------------------------------------------- Start View All

print "<html><head>

<style>body{scrollbar-face-color: $color2; scrollbar-shadow-color: $color3;
scrollbar-highlight-color: $color2; scrollbar-3dlight-color: $color3;
scrollbar-darkshadow-color: $color2; scrollbar-track-color: $color2;
scrollbar-arrow-color: $color3;}</style>

<title>:: sBOX : All Shouts</title>

<link rel='stylesheet' href='sBOX.css' type='text/css'></head>

<body style=\"margin: 0pt;\" class=\"background\">";

$file = "data.dat";
$fp = fopen ($file, "r") or die ("error when reading $file");
while ( !feof ($fp) ) {
$line = fgets ($fp, 9216);
print "<table width=\"130\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" align=\"center\">
<tr>
<td class=\"table_1\"><span class=\"text\">$line</span></td>
</tr></table>";

}

print "<br><div align=\"center\"><font face=\"Verdana\" color=\"$text\" size=\"1\">[ <a href=\"javascript:self.close()\">close</a> ]</div></font></body></html>";

//--------------------------------------------------------------------------- End View All

} elseif ($act == "help") {

//--------------------------------------------------------------------------- Start Help

print "<html>
<head>
<title>:: sBOX : Info</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<link rel='stylesheet' href='sBOX.css' type='text/css'>

<script language='javascript'>
<!--
function smilie(code)
{
opener.document.input.info.value += ' ' + code + ' ';
}
//-->
</script>

</head>

<body bgcolor=\"$color1\" text=\"$text\" style=\"margin: 0pt;\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" height=\"400\">
<tr>
<td valign=\"top\" class=\"table_1\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"header\"><span class=\"text\"><b>:: What is sBOX?</b></span></td>
</tr>
</table>
<span class=\"text\">sBOX is a shoutbox which enables users of a site to leave messages or to chat
with other online usres. To get yours points your browser to <a href=\"http://endity.com\" target=\"_blank\">http://endity.com</a></span><br>
<br>
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"header\"><span class=\"text\"><b>:: Bcode</b></span></td>
</tr>
</table>
<span class=\"text\">sBOX has the ability to convert smilies. It also has certain codes for
links etc. Heres a list of the codes that can be used: </span><br>
<br>
<table width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" class=\"table_1\">
<tr>
<td width=\"25%\">
<div align=\"center\">:)</div>
</td>
<td width=\"25%\">
<div align=\"center\"><a href=\"javascript:smilie(':)')\"><img src=\"smilies/smile.gif\" border=\"0\"></a></div>
</td>
<td width=\"25%\">
<div align=\"center\">:D</div>
</td>
<td width=\"25%\">
<div align=\"center\"><a href=\"javascript:smilie(':D')\"><img src=\"smilies/biggrin.gif\" border=\"0\"></a></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\">:(</div>
</td>
<td>
<div align=\"center\"><a href=\"javascript:smilie(':(')\"><img src=\"smilies/sad.gif\" border=\"0\"></a></div>
</td>
<td>
<div align=\"center\">:@</div>
</td>
<td>
<div align=\"center\"><a href=\"javascript:smilie(':@')\"><img src=\"smilies/mad.gif\" border=\"0\"></a></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\">;)</div>
</td>
<td>
<div align=\"center\"><a href=\"javascript:smilie(';)')\"><img src=\"smilies/wink.gif\" border=\"0\"></a></div>
</td>
<td>
<div align=\"center\">8)</div>
</td>
<td>
<div align=\"center\"><a href=\"javascript:smilie('8)')\"><img src=\"smilies/cool.gif\" border=\"0\"></a></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\">:P</div>
</td>
<td>
<div align=\"center\"><a href=\"javascript:smilie(':P')\"><img src=\"smilies/bigrazz.gif\" border=\"0\"></a></div>
</td>
<td>
<div align=\"center\">???</div>
</td>
<td>
<div align=\"center\"><a href=\"javascript:smilie('???')\"><img src=\"smilies/confused.gif\" border=\"0\"></a></div>
</td>
</tr>
</table> <br>
<table width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" class=\"table_1\">
<tr>
<td width=\"84%\">
<div align=\"center\">[url]http://end<br>
ity.com[/url]</div>
</td>
<td width=\"16%\">
<div align=\"center\">[<a href=\"http://endity.com\" target=\"_blank\">www</a>]</div>
</td>
</tr>
<tr>
<td width=\"84%\">
<div align=\"center\">[mail]name@msn<br>
.com[/mail]</div>
</td>
<td width=\"16%\">
<div align=\"center\">[<a href=\"mailto:name@msn.com\">@</a>]</div>
</td>
</tr>
</tr>
</table>
<br><table width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" class=\"table_1\">
<tr>
<td class=\"header\" align=\"center\"><b><a href=\"http://endity.com\" target=\"_blank\">sBOX v2.0</a></b></td>
</table>
</body>
</html>";

//--------------------------------------------------------------------------- End Help

} else {

//--------------------------------------------------------------------------- Start Board View

$file = "data.dat";
$fp = fopen ($file, "r+") or die ("error when reading $file");
$mess = file($file);

if ( isset($user_name) ) { $name2 = "$user_name"; } else { $name2 = "name"; }

if ( isset($user_site) ) { $site2 = "$user_site"; } else { $site2 = "http://"; }

if ($name2 == "$name" ) { $name2 = "name"; }

if ($info2 == "$info" ) { $info2 = "message"; }

if ($site2 == "$site" ) { $site2 = "http://"; }

if ($name2 == "$user_name") { $wel = "$user_name!"; } else { $wel = "Guest!"; }

if ($message == "") { $message = "Welcome $wel"; }

$name2 = strip_tags($name2,"");
$message = str_replace("","<i>",$message);
$message = str_replace("
","</i>",$message);
$name2 = str_replace("","",$name2);
$name2 = str_replace("
","",$name2);

print "<html>

<head>

<script type=\"text/javascript\">

function pop(url) {
var Win = window.open(url,\"openScript\",'width=' + 150 + ',height=' + 400 + ',resizable=no,scrollbars=yes,menubar=no,status=no' );
}

</script>

<script language=\"JavaScript\" type=\"text/javascript\">
<!--
function expand(Menu) {
if (Menu.style.display==\"none\") {
Menu.style.display=\"\";
}
else {
Menu.style.display=\"none\";
}
window.event.cancel=true;
}
function contract(Menu) {
if (Menu.style.display==\"show\") {
Menu.style.display=\"\";
}
else {
Menu.style.display=\"none\";
}
window.event.cancel=true;
}
//-->
</script>

<link rel='stylesheet' href='sBOX.css' type='text/css'>

</head>
<body style=\"margin: 0pt;\" scroll=\"$scroll\" class=\"background\">";
print "<table width=\"130\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
<tr>
<td class=\"border\">
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">
<tr>
<td class=\"header\"><span class=\"text\"><b>sBOX</b> & <a href=\"javascript:pop('sBOX.php?act=all')\">Shouts</a> : <a href=\"javascript:pop('sBOX.php?act=help')\">Help</a></span></td>
</tr>
<tr>
<td class=\"table_2\" align=\"center\"><span class=\"text\"><b>$message</b></span></td>
</tr>
<tr>
<td class=\"table_1\"><span class=\"text\">$mess[0]</span></td>
</tr>
<tr>
<td class=\"table_2\"><span class=\"text\">$mess[1]</span></td>
</tr>
<tr>
<td class=\"table_1\"><span class=\"text\">$mess[2]</span></td>
</tr>
<tr>
<td class=\"table_2\"><span class=\"text\">$mess[3]</span></td>
</tr>
<tr>
<td class=\"table_1\"><span class=\"text\">$mess[4]</span></td>
</tr>
<tr>
<td class=\"table_2\"><span class=\"text\">$mess[5]</span></td>
</tr>
<tr>
<td class=\"table_1\"><div id=\"unseen\" style=\"display:none\">
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">
<tr>
<td class=\"table_1\" width=\"10\"><img src=\"smilies/minus.gif\" border=0 alt=\"\" onclick=\"expand(seen);contract(unseen);\" style=\"cursor: hand\"></td><td class=\"table_1\"><span class=\"text\"><b>Fill in the fields:</b></span></td></tr>
<tr colspan=\"2\"><td class=\"table_1\" colspan=\"2\">
<div align=\"center\"><form name=\"input\" method=\"post\" action=\"sBOX.php?act=add\">
<input type=\"text\" name=\"name\" value=\"$name2\" onfocus=\"this.value=''\" class=\"input\" size=\"17\"><br>
<input type=\"text\" name=\"site\" value=\"$site2\" class=\"input\" size=\"17\">
<br>
<input type=\"text\" name=\"info\" value=\"$info2\" onfocus=\"if (this.value=='message') {this.value=''}\" class=\"input\" size=\"17\"><br>
<input type=\"submit\" name=\"Submit\" value=\" Hit \" class=\"hit\"><font color=\"#FF0000\"></font>
</form></div></td>
</tr></table></div>
<div id=\"seen\" style=\"display:show\">
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">
<tr>
<td class=\"table_1\" width=\"10\"><img src=\"smilies/plus.gif\" border=0 alt=\"\" onclick=\"contract(seen);expand(unseen);\" style=\"cursor: hand\"></td>
<td class=\"table_1\"><span class=\"text\"><b>Click To Expand</b></span></td>
</tr></table>
</td>
</tr>
</table></div>
</td>
</tr>
</table>";

//--------------------------------------------------------------------------- End Board View

}

?>
this code has worked before. I think i had to change error_reporting in the php.ini
what is the error reporting code for it to show errors but still run the code?
Tim
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Mar 31, 2003 8:31 pm

Postby Tim » Sun Apr 13, 2003 11:59 am

if you haven't guessed i run my own webserver
Tim
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Mar 31, 2003 8:31 pm


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.