No one looks at codes >.>
And anyone who wants to help me add me to MSN *REMOVED* ;D
Correctable (Forum Moderator) - Do not give out personal information!

No one looks at codes >.>
And anyone who wants to help me add me to MSN *REMOVED* ;D
Correctable (Forum Moderator) - Do not give out personal information!
Last edited by lMattz; 09-08-2006 at 08:13 AM.
Maybe something in your code you already have is interfering with it and making it send the message anyway.
PHP Code:[LEFT]<?[/LEFT]
[LEFT]$name = $_GET['name'];[/LEFT]
[LEFT]echo "Hi, your name is $name";[/LEFT]
[LEFT]?>[/LEFT]
[LEFT][/LEFT]
Yes, there is a section for coding![]()
This is what i have now..
Code:<?php $name = $_POST['name']; $message = $_POST['message']; $tag = ("<font size=\"1\" face=\"verdana\"> <b>$name</b>; $message </font><br><br>"); $read = fopen("content.txt", "r"); $contents = fread($read, filesize('content.txt')); fclose($read); $write = fopen("content.txt", "w"); fwrite($write, "$tag $contents"); fclose($write); print "<meta http-equiv=\"refresh\" content=\"0;shoutbox.php\">"; if(!$name) { echo " <script language='javascript'> alert('Fill in your name'); </script> "; } ?>
Ooooh i know brb.
Nvm.
Edited by ---MAD--- (forum moderator): Please do not pointless post, thanks![]()
Last edited by ---MAD---; 08-08-2006 at 10:00 PM.
Because it's refreshing before the Javascript is sent.
PHP Code:[LEFT]<?[/LEFT]
[LEFT]$name = $_GET['name'];[/LEFT]
[LEFT]echo "Hi, your name is $name";[/LEFT]
[LEFT]?>[/LEFT]
[LEFT][/LEFT]
Hmm so post the code which should work then pls.
Try:
PHP Code:<?php
$name = $_POST['name'];
$message = $_POST['message'];
$tag = ("<font size=\"1\" face=\"verdana\">
<b>$name</b>; $message
</font><br><br>");
$read = fopen("content.txt", "r");
$contents = fread($read, filesize('content.txt'));
fclose($read);
$write = fopen("content.txt", "w");
fwrite($write, "$tag $contents");
fclose($write);
if(!$name) {
echo "
<script language='javascript'>
alert('Fill in your name');
</script>
";
}
else {
print "<meta http-equiv=\"refresh\" content=\"0;shoutbox.php\">";
}
}
?>
Last edited by Fujitsu; 08-08-2006 at 09:11 PM.
PHP Code:[LEFT]<?[/LEFT]
[LEFT]$name = $_GET['name'];[/LEFT]
[LEFT]echo "Hi, your name is $name";[/LEFT]
[LEFT]?>[/LEFT]
[LEFT][/LEFT]
that wont work. theres a little error
Try:
oops lost the errorPHP Code:
<?php
$name = $_POST['name'];
$message = $_POST['message'];
$tag = ("<font size=\"1\" face=\"verdana\">
<b>$name</b>; $message
</font><br><br>");
$read = fopen("content.txt", "r");
$contents = fread($read, filesize('content.txt'));
fclose($read);
$write = fopen("content.txt", "w");
fwrite($write, "$tag $contents");
fclose($write);
if(!$name) {
echo "
<script language='javascript'>
alert('Fill in your name');
</script>
";
}
else {
print "<meta http-equiv=\"refresh\" content=\"0;shoutbox.php\">";
}
?>![]()
Last edited by ClubTime; 08-08-2006 at 09:15 PM.
Make sure you use some sort of frame to display the input and output seperatly
Want to hide these adverts? Register an account for free!