First, than-q for the responses. They were quite helpful. The good news is that I'm not getting the same error anymore. The bad news is that now I'm getting a new error:
Undefined index: ip in /var/www/html/submit.php on line 14, referrer: http://sandy/submit.php
I tried all three ideas, with the same result. Here's the code of the form, as it is currently:
<html>
<body>
<?php
if ($_POST) {
// process form
$link = mysql_connect('localhost', 'bmccollam', 'biteme');
mysql_select_db("abusedb",$link);
if(!get_magic_quotes_gpc())
$ip = mysql_real_escape_string($_POST['ip']);
else
$ip = mysql_real_escape_string( stripslashes($_POST['ip']) );
// $sql = "INSERT INTO sc_alert (ip) VALUES ('$ip')";
// $sql = "INSERT INTO sc_alert (ip) VALUES ('{$_POST['ip']}')";
// $sql = "INSERT INTO sc_alert (ip) VALUES ('$ip')";
// $sql = "INSERT INTO sc_alert (ip) VALUES ('".$_REQUEST['ip']."')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
Address:
<input name="address" type="text" id="ip">
<br>
<br>
<input type="submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</p>
</div>
</body>
</html>
The fact that it's a new error means that it's that much closer to cool. Any suggestions on how to squash the undefined index complaint?
For the record, register_globals is off, as is magic_quotes_gpc. Would that be the cause of this new issue? I can enable it, if needs be. The test box (sandy) is a vmware install on the workstation I'm using, so I can change anything I need to on it.