PHP/MySQL - No errors, but won't insert values into table?
Does this look right? Read the edit below for more information.
<?php
$database = "private";
mysql_connect ("private", "private", "private");
mysql_select_db($database) or die( "mysql_error()");
if (isset($_POST['post'])){
$link= htmlspecialchars(addslashes($_POST['link']));
$text= htmlspecialchars(addslashes($_POST['text']));
mysql_query("INSERT INTO leftnav (link,text) VALUES ('$link', '$text')");
}
?>
<?php
if($_SERVER['REMOTE_ADDR'] == 'private')
{
echo "
<div id='lheading'>private</div>
<form method='post'>
<center>
<font family='helvetica' size='1'>
Link: <input type='text' name='link' style='width:70px; font-family:helvetica; font-size:10px;'><br>
Text: <input type='text' name='text' style='width:70px; font-family:helvetica; font-size:10px;'><br>
<input type='submit' value='submit' style='width:100px; font-family:helvetica; font-size:10px;'>
</font>
</center>
</form>
";
}
else {
print "";
}
?>
I get NO error messages at all, and it just won't insert the information into the table. What's wrong? Whenever I import information on pmA it works just fine.
|