/ Published in: PHP
Expand |
Embed | Plain Text
<?php $self = $_SERVER['PHP_SELF']; //the $self variable equals this file $ipaddress = ("$_SERVER[REMOTE_ADDR]"); //the $ipaddress var equals users IP include ('connect.php'); // for db details $name = $_COOKIE['user']; } else { $name = 'Guest'; } } else { $sql = "INSERT INTO shouts SET name='$name', post='$post', ipaddress='$ipaddress';"; } else { } } } $query = "SELECT * FROM `shouts` ORDER BY `id` DESC LIMIT 50;"; $result = @mysql_query($query) or die('<p class="error">There was an unexpected error grabbing shouts from the database.</p>'); .$row['name'].':</div>'); } ?> <form action="<?php $self ?>" method="post"> <h4 style="padding: 0; margin: 1px;">Shoutbox</h4> <input name="send" type="hidden" /> <input type="submit" value="Shout" /> <h5 style="padding: 0; margin: 1px; color: #778899;">Shout:</h5><textarea name="post" cols="25" rows="1"></textarea> </form>
You need to login to post a comment.
