i am trying to make it so that all the text in the post screen is to scroll!
In the moment every time a message get's posted it pushes the 3 boxes down (name, email, message) so that at the end you would have to scroll for does boxes.
i have used the div statement but that does not work, can someone tell me where or what i can do to make the post screen to scroll?
P.s: sorry about my bad grammar!
- <body bgcolor="black" text="yellow">
- <?php
- //PHP Guestbook using mySQL database
- echo "<h1>Guestbook</h1><hr>";
- //connect to the database
- $connect = mysql_connect("localhost","root","") or die ("Couldn't connect!");
- //select table
- mysql_select_db("**********") or die("couldn't find db");
- //use query to get ALL data
- $queryget = mysql_query("SELECT * FROM guestbook") or die("Error with query");
- while ($row = mysql_fetch_assoc($queryget))
- {
- //get row data and store in variables
- $id = $row['id'];
- $name = $row['name'];
- $email = $row['email'];
- $message = $row['message'];
- $date = $row['date'];
- $time = $row['time'];
- //show data to user
- echo "
- <table>
- <tr>
- <td>
- <b>Posted by $name ($email) on $date at $time</b>
- </td>
- </tr>
- <tr>
- <td>
- ".nl2br(strip_tags($message))."
- </td>
- </tr>
- </table>
- ";
- }
- echo "<hr>";
- if (isset($_POST['submit']))
- {
- $name = $_POST['name'];
- $email = $_POST['email'];
- $message = $_POST['message'];
- $date = date("Y-m-d");
- $time = date("H:i:s:");
- if ($name&&$email&&$message)
- {
- $querypost = mysql_query("INSERT INTO guestbook VALUES ('','$name','$email','$message','$date','$time')");
- echo "Please wait...<meta http-equiv='refresh' content='2'>";
- }
- else
- echo "Please fill out all fields!";
- }
- echo "
- <form action='guestbook.php' method='POST'>
- <table width='50%'>
- <tr>
- <td width='18%'>
- Username:
- </td>
- <td>
- <input type='text' name='name' maxlength='25'>
- </td>
- </tr>
- <tr>
- <td valign='top'>
- Email:
- </td>
- <td>
- <input type='text' name='email' maxlength='35'>
- </td>
- </tr>
- <tr>
- <td valign='top'>
- Your message:
- </td>
- <td>
- <textarea cols='20' rows='2' name='message' maxlength='250'> </textarea>
- <p>
- <input type='submit' name='submit' value='Post'>
- </td>
- </tr>
- </table>
- </form>
- ";
- ?>
