12-21-2009, 07:16 PM
This is my third project. Again for the sake of doing less work I uploaded it instead of pasting it.
Download:
http://www.mediafire.com/?yuntonjjnjz
Download:
http://www.mediafire.com/?yuntonjjnjz
<?php
$message=$_POST["message"];
$name=$_POST["fname"];
?>
<?php
$file=fopen("mboard.txt","a");
fwrite($file,$name);
fwrite($file,": ");
fwrite($file,$message);
fwrite($file,"<br><br>");
fclose($file);
?>
<script type="text/javascript">
<!--
window.location = "http://nevets04.comoj.com/board.php"
//-->
</script>
<?php
$message=$_POST["message"];
$name=$_POST["fname"];
$file=fopen("mboard.txt","a");
fwrite($file,$name);
fwrite($file,": ");
fwrite($file,$message);
fwrite($file,"<br><br>");
fclose($file);
echo <<<HTML
<script type="text/javascript">
<!--
window.location = "http://nevets04.comoj.com/board.php"
//-->
</script>
HTML;
?>
(12-21-2009, 11:47 PM)Master of The Universe Wrote: [ -> ]Yeah that can become a real pain.
If you don't switch to MySql, you can create new file for every post and allow only limited amount of characters (255 - 500).
The you can limit the load by addin Pagination (it's pretty simple), and just load 5 posts per side...
If you also use more files and not just one, you can easy delete specified posts.
But I gone bit too far, are you planing to make this better or is it just a learning project?
Thanks (Click to View)Thanks for the REP
fwrite($file, $name . ": " . $message . "<br><br>");
(12-22-2009, 07:57 AM)Spl3en Wrote: [ -> ]Nice script !
But, be careful !
When you display the messages, don't forget htmlentities !
You will be victim of XSS if you don't use that.
PS : You can concatenate string and variables like this, if you want :
PHP Code:fwrite($file, $name . ": " . $message . "<br><br>");