View previous topic :: View next topic |
Author |
Message |
PsychoticLucky7 -
Joined: 18 Aug 2004 Posts: 15
|
Posted: Wed Aug 18, 2004 2:39 am Post subject: 404 error when trying to post a message on my shoutbox |
|
|
I can't work my shoutbox, Every one of the scripts works, except for when I try to post a message, then it returns 404 page not found. I know that I have specified the right directory for the scripts. I changed some things in one of the scripts(the very last one executed before the message is posted) to make it fail and the server told me that there was something wrong with the script. The problem seems to occur when writing to the "shout.txt" file. I read some things about javascript, that it can't modify files on your hard drive, is this same security applied to php script? _________________ InSaNiTy Is A gIfT! |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Aug 18, 2004 4:32 am Post subject: |
|
|
I don't think I can help you with the 404 error , it is up to you to configure
the script properly but for the PHP restrictions part , PHP can modify a file.
Javascript is client side and adding such a feature could allow
websites to collect personal information or even passwords. |
|
Back to top |
|
 |
PsychoticLucky7 -
Joined: 18 Aug 2004 Posts: 15
|
Posted: Wed Aug 18, 2004 4:37 am Post subject: |
|
|
TRUSTpunk wrote: | I don't think I can help you with the 404 error , it is up to you to configure
the script properly but for the PHP restrictions part , PHP can modify a file.
Javascript is client side and adding such a feature could allow
websites to collect personal information or even passwords. |
Thanks man, you have helped a lot just with that small reply, now that I know that php can modify files, I just have to figure out what else would be wrong with it...
Thanks greatly! _________________ InSaNiTy Is A gIfT! |
|
Back to top |
|
 |
PsychoticLucky7 -
Joined: 18 Aug 2004 Posts: 15
|
Posted: Wed Aug 18, 2004 4:42 am Post subject: |
|
|
Is there anyone out there who hosts a shoutbox that can help me in any way, or point me in the direction of an extensive tutorial??
PLEASE, thanks in advance! _________________ InSaNiTy Is A gIfT! |
|
Back to top |
|
 |
PsychoticLucky7 -
Joined: 18 Aug 2004 Posts: 15
|
Posted: Wed Aug 18, 2004 10:36 pm Post subject: |
|
|
I found the file that was wrong with my shoutbox, but I don't know php, can someone help me please, Thanks...
Code: |
<?php
// Thank You For Downloading Only Shout - ShoutBox
// Coded By : Umut Kale - www.onlyphp.com
// The data file where messages are stored.
$dataf = "onlyshout.txt";
// Max length must be edited in onlyshout.php also.
$length = 55;
// Number of messages shown.
$comments = 12;
//------------------------------
//------------------------------
//-------- Do Not Edit ----------
// ------------------------------
// ------------------------------
$textsize = 4;
if (!$name)
{ $name = "||"; }
else $name .= ":";
$name = str_replace("/\/","edited",$name);
$name = preg_replace("/>/",">",$name);
$name = preg_replace("/</","<",$name);
$name = preg_replace('/"/','',$name);
$email = preg_replace('/"/','',$email);
$message = preg_replace('/"/','',$message);
$url = preg_replace('/"/','',$url);
$name = str_replace("onmouse","",$name);
$email = str_replace("onmouse","",$email);
$message = str_replace("onmouse","",$message);
$url = str_replace("onmouse","",$url);
$message = preg_replace("/>/",">",$message);
$message = preg_replace("/</","<",$message);
$url = preg_replace("/>/",">",$url);
$url = preg_replace("/</","<",$url);
$url = str_replace("echo","****",$url);
$url = str_replace("/\/","edited",$url);
$email = preg_replace("/>/",">",$email);
$email = str_replace("echo","****",$email);
$email = str_replace("/\/","edited",$email);
$email = preg_replace("/</","<",$email);
$url = str_replace("/\/","edited",$url);
$message = str_replace("/\/","edited",$message);
$message = str_replace("ASSHOLE","****",$message);
$message = str_replace("?php","****",$message);
$message = str_replace("?php","****",$message);
$message = str_replace("CENSORED","****",$message);
$name = str_replace("echo","****",$name);
$message = str_replace("echo","****",$message);
$message = str_replace("CENSORED","****",$message);
$message = str_replace("bitch","****",$message);
$message = str_replace("asshole","****",$message);
$message = str_replace("cunt","****",$message);
$message = str_replace("bullshit","****",$message);
$message = str_replace("shit","****",$message);
$message = str_replace(":)","<img src='smile.gif'>",$message);
$message = str_replace(":8","<img src='smile-2.gif'>",$message);
$message = str_replace(":wacko:","<img src='wacko.gif'>",$message);
$message = str_replace(":huh:","<img src='unsure.gif'>",$message);
$message = str_replace(":P","<img src='toung.gif'>",$message);
$message = str_replace(":suspicious:","<img src='suspicious.gif'>",$message);
$message = str_replace(":hehe:","<img src='wink.gif'>",$message);
$message = str_replace(":worried:","<img src='worried.gif'>",$message);
$message = str_replace(":eek:","<img src='weird.gif'>",$message);
$message = str_replace(":(","<img src='sad.gif'>",$message);
$message = str_replace(":sad:","<img src='sad-2.gif'>",$message);
$message = str_replace(":x","<img src='sick.gif'>",$message);
$message = str_replace(":rolleyes:","<img src='rolleyes.gif'>",$message);
$message = str_replace(":push:","<img src='push.gif'>",$message);
$message = str_replace(":0","<img src='oh.gif'>",$message);
$message = str_replace(":o","<img src='amazed.gif'>",$message);
$message = str_replace("8()","<img src='nuts.gif'>",$message);
$message = str_replace(":|","<img src='notrust.gif'>",$message);
$message = str_replace(":mad:","<img src='mad.gif'>",$message);
$message = str_replace(":lol:","<img src='laugh.gif'>",$message);
$message = str_replace(":huh:","<img src='huh.gif'>",$message);
$message = str_replace(":blush:","<img src='embarrest.gif'>",$message);
$message = str_replace(":cry:","<img src='crying.gif'>",$message);
$message = str_replace(":cool:","<img src='cool.gif'>",$message);
$message = str_replace(":confused:","<img src='confused.gif'>",$message);
$message = str_replace(":cheese:","<img src='cheesy.gif'>",$message);
$message = str_replace(":blink:","<img src='blink.gif'>",$message);
$message = str_replace(":big:","<img src='bigsmile.gif'>",$message);
$message = str_replace(":amuse:","<img src='amuse.gif'>",$message);
$message = stripslashes($message);
$name = stripslashes($name);
$email = stripslashes($email);
$url = stripslashes($url);
$wrap = intval((35)/($textsize-2))+1;
$message = wordwrap($message, $wrap, ' ', 1);
$comfile = file($dataf);if ($message != "") {$df = fopen ($dataf, "w");$message = stripslashes($message);fwrite ($df, "<i><a href=mailto:$email>@</a> <a href=$url target=_blank>$name</a></i> $message\n<br>");for ($i = 0; $i < $comments; $i++) {fwrite ($df, $comfile[$i]);}fclose($df);}
Header("Location: $HTTP_REFERER");
?>
|
_________________ InSaNiTy Is A gIfT! |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|