I dont know how to describe this problem, so check this out
http://meowmix.servebeer.com/public/ue/shout.php
Fill it out, hit submit, then hit refresh. It'll post another entry.
Here's the code for the page
<?
if (isset($_POST['shoutSubmit'])) {
require ('variables.php');
$link = mysql_connect("$mysql_host", "$mysql_login", "$mysql_password") or die("Could not connect");
mysql_select_db("$mysql_database") or die("Could not select database");
$name = $_POST['name'];
$url = $_POST['url'];
$comment = $_POST['comment'];
$query = "INSERT INTO $var_table (name, url, comment) VALUES ('$name', '$url', '$comment')";
$result = mysql_query($query) or die("Database Error: Error #0001");
unset($_POST['shoutSubmit']);
mysql_close($link);
}
?>
<iframe src="read.php" width="300" height="350" frameborder="0" scrolling="yes"></iframe>
<form enctype="multipart/form-data" method="post" action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td align="right" width="35%">name : </td>
<td width="65%">
<input type="text" name="name">
</td>
</tr>
<tr>
<td align="right" width="35%">website : </td>
<td width="65%">
<input type="text" name="url">
</td>
</tr>
<tr>
<td align="right" width="35%">comments : </td>
<td width="65%">
<input type="text" name="comment">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="shoutSubmit" value="shout!">
</td>
</tr>
</table>
</form>
read.php is simply a SELECT query. As you can see, I tried to unset the submit button, but that didnt work. It still sends the INSERT query again on refresh.
Any help would be appreciated.