Trouble with false submits

wxdqz

New Member
I have at least one thing wrong here for what I wish to do, and don\'t have a clue. I have tried several approaches and looked in the manual many times, but can\'t seem to find what I am in need of. I am using PHP3 and MySQL.
I want to insert user input in 6 tables on submit(this it does fine), I have the submit button named \"submit\" and yet anytime the page loads or refreshes it submits.

Thanks in advance
Jim

<PRE>
<?php

if ($submit);

{

$db = mysql_connect(\"localhost\", \"user_name\", \"password\");

mysql_select_db(\"database_name_com\",$db);

$zip = addslashes($zip);
$uName = addslashes($uName);
$pword = addslashes($pword);
$fName = addslashes($fName);
$lName = addslashes($lName);
$add = addslashes($add);
$mPhone = addslashes($mPhone);
$mEmail = addslashes($mEmail);
$website = addslashes($website);
$catName = addslashes($catName);
$header = addslashes($header);
$body = addslashes($body);
$conAdd = addslashes($conAdd);
$stDate = addslashes($stDate);
$endDate = addslashes($endDate);
$comment = addslashes($comment);
$conName = addslashes($conName);
$conPhone = addslashes($conPhone);
$conEmail = addslashes($conEmail);
$conZip = addslashes($conZip);


$sql = \"INSERT INTO Table_1 (1Id, meth, zip, statusId, supId, uName, pword, fName, lName, add, phone, email, website, began) VALUES (\' \',\'$meth\',\'$zip\',\'1\',\'1\',\'$uName\',\'$pword\',\'$fName\',\'$lName\',\'$add\',\'$mPhone\',\'$mEmail\',\'$website\',\'$began\')\";

$result = mysql_query($sql);

$sql = \"INSERT INTO Table_2 (2Id, uName, catName, covArea, wRate, header, body, conAddress, phId, stdate, endDate, comment, began, ST) VALUES (\' \',\'$uName\',\'$catName\',\'$covArea\',\'1\',\'$header\',\'$body\',\'$conAddress\',\'1\',\'$stDate\',\'$endDate\',\'$comment\',\'$began\',\'$ST\')\";

$result = mysql_query($sql);
//and so on for the rest of the tables


}
?>
</PRE>
 
Back
Top