I am trying to make a form that will submit data to our mysql database this is my form code:
Audition Portal
Student First Name:
Student Last Name:
Gender Select... Male Female
Phone:
Parent First Name:
Parent Last Name:
Please check ALL submitted paperwork:
Recommendation Letter #1
Yes
No
Recommendation Letter #2
Yes
No
Report Card/Transcript
Yes
No
I have created an additional page that is titled: add_student.php
That pages code includes:[php]<?php
$con = mysql_connect(“localhost”,“database_admin”,“Password”);
if (!$con)
{
die('Could not connect: ’ . mysql_error());
}
mysql_select_db(“database”, $con);
$sql=“INSERT INTO students
(contact_id
, StudentFirstName
,
StudentLastName
, Gender
, Phone
, ParentFirstName
,
ParentLastName
, Rec1
, Rec2
, ReportCard
) VALUES
(’$POST_[id]’,’$POST_[sfname]’,’$POST_[slname]’,’$POST_[sgender]’,’$POST_[phone]’,’$POST_[pfname]’,’$POST_[plname]’,’$POST_[rec1]’,’$POST_[rec2]’,’$POST_[reportcard]’)”;
if (!mysql_query($sql,$con))
{
die('Error: ’ . mysql_error());
}
echo “Student record added”;
mysql_close($con);
?>[/php]
When I click submit on the form page it just reloads with the submission values in the URL and it doesn’t post them to the database ( I know this because I use phpMYAdmin and nothing is in that table).
What am I doing wrong