8 # http://www.codejungle.org/site/Shoutbox+mit+PHP+und+Ajax.html
11 $filename="wishlist.txt";
13 // be sure the file have write permissions
14 $url="http://tinc-vpn.org/wishlist/";
18 function get_content(){
20 $lines = file ($filename);
21 $start = count($lines)-12;
22 if ($start < 1) $start = 1;
23 for ($i = $start; $i < count ($lines); $i++){
24 $somecontent.=stripslashes($lines[$i]);
29 function add_content(){
31 if($_POST[submit] and $_POST[nick] and $_POST[content]){
34 $_SESSION["nick"]=$_POST[nick];
35 $somecontent=strip_tags($_POST[nick]).": ".strip_tags($_POST[content])."<br/>n";
36 $handle = fopen($filename, 'a+');
37 fwrite($handle, $somecontent);
41 function output_form(){
44 <form action="" method="post">
47 echo $_SESSION[nick].'<input type="hidden" name="nick" value="'.$_SESSION[nick].'"><br>';
50 echo '<br><input name="nick" type="text" value="'.$_SESSION[nick].'"><br>';
53 Your Wish/Idea for the tinc Project:<br>
54 <textarea rows="5" cols="100" name="content"></textarea><br>
55 <input type="submit" name="submit" value="save">
61 if($_GET[content]=="true"){
68 ##Drop your Ideas into this Box
69 ####(The Idea will stay for a while and will check form the dev. Team)
71 <?php add_content(); ?>
72 <div style="border:1px solid #ccc; width:500px; height:300px; max-height:300px; overflow:auto;" name="shoutbox" id="shoutbox"></div>
73 <?php output_form(); ?>