
Originally Posted by
kuau
You left the single quotes out...
Code:
$_POST['first_name']
okay I have added the single quotes and I still can't post to the server. Here is the code along with my form. I think it's something in my form...
PHP Code:
$insert = "INSERT INTO users (first_name, last_name, email, gender, city, state, country, username, password)
VALUES ('".$_POST['first_name']."', '".$_POST['last_name']."', '".$_POST['email']."', '".$_POST['gender']."', '".$_POST['city']."', '".$_POST['state']."', '".$_POST['country']."', '".$_POST['username']."', '".$_POST['pass']."', '".$_POST['pass2']."')";
//VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; //reference Code
$add_member = mysql_query($insert);
HTML Code:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table width="379" border="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><span class="formw_signup"><strong>First Name:*</span></strong></td>
<td><input name="first_name" type="text" id="first_name" maxlength="50"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong> Last Name:*</span></strong></td>
<td><input name="last_name" type="text" id="last_name" maxlength="50"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong><span class="formw_signup"><strong>Email Address:*</span></strong></td>
<td><input name="email" type="text" id="email" maxlength="50"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong><span class="formw_signup"><strong>Mailing Address:</span></strong></td>
<td><input name="address" type="text" id="address" maxlength="40"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong>City:*</span></strong></td>
<td><input name="city" type="text" id="city" maxlength="25"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong>State:*</span></strong></td>
<td><input name="state" type="text" id="state" maxlength="20"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong>Postal Code:</span></strong></td>
<td><input name="zip" type="text" id="zip" maxlength="10"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong>Country:*</span></strong></td>
<td><input name="country" type="text" id="country" maxlength="25"></td>
</tr>
<tr>
<td><span class="formw_signup"><strong>Gender:*</span></strong></td>
<td><select name="gender" id="gender">
<option>Choose a Gender</option>
<option value="M">M</option>
<option value="F">F</option>
</select></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><span class="formw_signup"><strong>Website Address:</span></strong></td>
<td><input name="website" type="text" id="website" value="http://" maxlength="100"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="201"><span class="formw_signup"><strong>Username:* (3-15 charcters)</span></strong></td><td width="153">
<input type="text" name="username" maxlength="15">
</td></tr>
<tr>
<td><span class="formw_signup"><strong> Password:*</strong></td><td>
<input type="password" name="pass" maxlength="25">
</td></tr>
<tr>
<td><span class="formw_signup"><strong>Confirm Password:*</strong></td>
<td><input type="password" name="pass2" maxlength="25"></td>
</tr>
<tr>
<td colspan="2"><div align="center"><strong><span class="formw_signup">* Required field</span> </strong></div></td></tr>
<tr>
<th class="formw_signup"> </th>
<th class="formw_signup"> </th>
</tr>
<tr><th colspan=2><input type="submit" name="submit" value="Sign Up"></th></tr> </table>
</form>
Bookmarks