quote script
Jeg har et quotescript her og det virker også.. Men der er en bug. Det er at nogle gange skriver den ikke noget.. Og jeg har set efter at der ikke er nogle tomme felter i min mysql.Script:
<span id="smallo">Quotes</span>
<br><br><br>
<span id="underover">Her kan du se/add quotes!</span>
<br><br>
<a href="stuffquote.php?quote=add">Add Quote</a><br>
<?PHP
if($_GET['quote'] == 'add'){
if($submit) {
$ip = $_SERVER[REMOTE_ADDR];
$tid = date("G:i l d/n (F) - Y ");
mysql_query("INSERT INTO quotesys (quote,author,tid,ip) VALUES ('$_POST[quote]','$_POST[author]','$tid','$ip')");
print "<script language=\"javascript\">location.replace('stuffquote.php');</script>" ;
} else {
}
?>
<form action="stuffquote.php?quote=add" method="POST">
<table>
<tr>
<td width="40" id="optional">Nick:</td> <td><input onmouseover="this.style.backgroundColor = '#ADC438';" onmouseout="this.style.backgroundColor = '#FFFFFF';" id="formfield" type="text" name="author" value=""></td>
</tr>
<tr>
<td width="40" id="optional">Quote</td> <td><input onmouseover="this.style.backgroundColor = '#ADC438';" onmouseout="this.style.backgroundColor = '#FFFFFF';" id="formfield" type="text" name="quote" value=""></td>
</tr>
<tr>
<td width="40"></td> <td><input onmouseover="this.style.backgroundColor = '#ADC438';" onmouseout="this.style.backgroundColor = '#FFFFFF';" id="submit" type="submit" name="submit" value="addquote"> </td>
</tr>
</table>
</form>
<?PHP
} else {
}
?>
<br><br><br>
<table width="400" cellspacing="0" cellpadding="0" id="tagwall">
<tr><td width="70%" id="tagwallheader">Quote:</td><td width="30%" id="tagwallheader">Author:</td></tr>
<?PHP
$aa_quote = mysql_query("SELECT quote,author FROM quotesys");
WHILE($squote = mysql_fetch_array($aa_quote)) {
print "<tr><td id=pad>$squote[quote]</td><td id=pad>$squote[author]</td></tr>";
}
?>
</table>
Kan i se hvorfor??
