I have a post comments feature on my site for different essays or short stories. The problem is, instead of adding what you typed for Name, Email, Site, and Comment, it adds a 0 to the db. Everything else works, stuff that you can't change in the form like ip address, timestamp, and the id of the article you are commenting on. Any idea why it does this? I'll give you more info if you want. Thanks for any help, I've spent so much time trying to figure this [censored] out.
Here is the code for the page that does the adding, which is seperate from the page you post from:
<?PHP
include("dbconnect.php");
IF($nraktion == "ssub") {
IF ($wc_name == "name") {
$wc_name = "A Stranger";
} ELSEIF ($wc_name == "" ) {
$wc_name = "A Stranger";
}
IF ($wc_email == "email") {
$wc_email = "none";
} ELSEIF ($wc_email == "" ) {
$wc_email = "none";
}
IF ($wc_site == "http://") {
$wc_site = "none";
} ELSEIF ($wc_site == "" ) {
$wc_site = "none";
}
IF ($wc_content == "") {
echo ("You radge, you left the message box blank and should be banned from the internet entirely.");
} ELSE {
$ip = getenv("REMOTE_ADDR");
mysql_query("INSERT INTO writcomments (ip,nid,name,email,site,content,timestamp) VALUES ('$ip','$nid','$wc_name','$wc_email','$wc_site','$wc_content',".time().")");
ECHO ("<img src=main/post/posting.gif alt=\"Posting\">");
} //END ELSE FOR CONTENT
} //END IF NRAKTIOn == SSUB
?>
And yes, I know. include is dying and require is the way to go. I know. Whatever.