ok trying to fix a simple page i had working before on my site
basically its just to add a user's info to my mailing list db
somewhere along the lines this page broke? not sure how but i cant seem to fix it
every sample script i steal code from inputs a blank record into my db if it works at all 🙁 not too happy right now as ive spent a good part of a day trying to work thru this
ok here's my code:
submitform.html
<html>
<body>
<form action=submitform.php method=GET>
<!-- my added code here -->
<table align="center" width="80%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td class="subhead">First Name</td>
<td><input type="text" name="fname" size="30"></td>
</tr>
<tr>
<td class="subhead">Last Name</td>
<td><input type="text" name="lname" size="30"></td>
</tr>
<tr>
<td class="subhead">City</td>
<td><input type="text" name="city" size="30"></td>
</tr>
<tr>
<td class="subhead">State</td>
<td><input type="text" name="state" size="30"></td>
</tr>
<tr>
<td class="subhead">Age</td>
<td><input type="text" name="age" size="30"></td>
</tr>
<tr>
<td class="subhead">ISP</td>
<td><input type="text" name="isp" size="30"></td>
</tr>
<tr>
<td class="subhead">Email</td>
<td><input type="text" name="email" size="30"></td>
</tr>
<tr>
<td class="subhead">AIM</td>
<td><input type="text" name="aim" size="30"></td>
</tr>
<tr>
<td class="subhead">Yahoo IM</td>
<td><input type="text" name="yahoo_im" size="30"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
then the submitform.php code:
<html>
<body>
<?php
mysql_connect ("localhost", "mysqluser", "********");
mysql_select_db ("bennies");
mysql_query ("INSERT INTO users (id, fname, lname, city, state, age, isp, email, aim, yahoo_im)
VALUES ('$id', '$fname', '$lname', '$city', '$state', '$age', '$isp', '$email', '$aim', '$yahoo_im')
");
print ($fname);
print (" ");
print ($lname);
print ("<p>");
print ("Thanks for submitting your name.");
?>
</body>
</html>
after submission i see the: Thanks for submitting your name text and a new blank record in my db?
why isnt php taking my values from the form correctly? i basically took the code line for line from a tutorial i found
thanx for all the help
bb~deux!