Below is my code. I connect fine to the database but obviously, I am not collecting data from my form. I first had an htm file sending data to the php file. I then moved all in one file... Still doesn't work. I am not a very experienced php coder.. as you will see, but I need help with this please:
THE PHP code:
<?php
// setting connection infomation.
if (!empty($_POST))
{
//Setting content parameters
$dDid= $POST ['dnAddress'];
$dTitle= $POST['dntitle'];
$dLName= $POST['dnLName'];
$dFName= $POST['dnFName'];
$Email= $POST['dnEmail'];
$dCity= $POST['dnCity'];
$dProv= $POST['dnProv'];
$dZip= $POST['dnPCode'];
$dPhm= $_POST['dnPhmain'];
// connect to the mysql database server. $connect = @mysql_connect ($host, $user, $pass);
$gozy = mysql_connect($hsrv, $uzrname, $uzrpwd);
mysql_select_db("fafuzr", $gozy) or die( "Unable to select database");
$query = mysql_query ("INSERT INTO personnes
(
Did,
dTitle,
dLName,
dFName,
dEmail,
dAdCity,
dAdProv,
dAdZip,
dPhMain,
)
VALUES
(
$dDid,
$dTitle,
$dLName,
$dFName,
$dEmail,
$dCity,
$dProv,
$dZip,
$dPhm
)");
printf("Last inserted record has id %d\n", mysql_insert_id());
if ( mysql_query ( $query ) )
{
$success = 'New donor added';
}
else {
die ( mysql_error () );
}
}
?>
THE html PART:
<FORM METHOD="POST" NAME="frmdonation" ACTION="<?echo$PHP_SELF?>">
<tr>
<td colspan="2">
<p class="titre"><b>4. Tell us about you...</p>
</td>
</tr>
<tr>
<td width="353" height="166">
<table width="320" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td width="130" height="30"><b>Title <font color="#999933">*</font></b></td>
<td width="180">
<select class="FT" style="width: 180px;" name="dntitle">
<option selected="selected"></option>
<option value="<?php echo $_POST['dntitle'] ?>">Mr.</option>
</select>
</td>
</tr>
<tr>
<td height="30"><b>First Name <font color="#999933">*</font></b></td>
<td>
<input class="FT" style="width: 180px;" maxlength="50" size="18" name="dnFName" value="<?php $_POST['dnFName'] ?>" />
</td>
</tr>
<tr>
<td height="30"><b>Last Name <font color="#999933">*</font></b></td>
(...)
<tr>
<td><input type="submit" value ="Proceed" name="Proceed"></td>
</tr>