Forum Moderators: coopster
i have this code:
<?
error_reporting (0);
$host="#*$!xx";
$user="#*$!x";
$password="#*$!x";
// Connect to the database server
$link = mysql_connect($host,$user,$password);
if(!$link) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
// Select the jokes database
if (! @mysql_select_db("log") ) {
echo( "<P>Unable to locate the log " .
"database at this time.</P>" );
exit();
}
Add your problem<br>
<?
if ("SUBMIT" == $adderror) {
$sql = "INSERT INTO errors (name, error) VALUES ('$name', '$error')";
if (mysql_query($sql)) {
echo("<P>Your error has been added.</P>");
} else {
echo("<P>Error adding submitted error: " .
mysql_error() . "</P>");
}
}
?>
<br>
<form name="form1" method="post" action="<?php echo($PHP_SELF);?>">
Name:
<input type="text" name="name">
<br><br>Error:
<input name="error" type="text" size="40">
<br>
<br><input type=SUBMIT name="adderror" value="Add">
</form></td>
</tr>
</table>
but when i load the page and enter the info into the fields then click the add button the form just refreshes and does not do nothing
please help thanks
[edited by: ergophobe at 1:03 am (utc) on Sep. 12, 2004]
[edit reason] snipped stylesheet and nested tables [/edit]