I am trying to have customers enter information into a form, and then enter that information into a database table after the customer clicks submit. I have been working on this for days and cannot figure out how to do the insert - please help!
<form class=“wufoo leftLabel” enctype=“multipart/form-data” method=“POST” action=”<?php $PHP_SELF ?>”>
<ul>
<li id=“fo1li2”
class=” ” >
<label class=“desc” id=“title2” for=“Field2”>
Name
*
</label>
<input id=“custfirst”
name=“custfirst”
class=“field text” size=“12”
tabindex=“1”
value=”” />
<label for=“Field2”>First</label>
</form>
<?php
if (!$_POST[‘submit’])
{
$custfirst=($_POST['custfirst']);
//open connection
$connection = mysql_connect('mysqlserver', 'uname', 'pwd');
//select db
mysql_select_db('database');
$insertstatement= "INSERT INTO custsignup (name) VALUES ('$custfirst')";
//execute insert statement
$result = mysql_query($insertstatement);
mysql_close($connection);
}
?>