Why on earth is this code not working.
if ($_POST[submitted] == 1) {
//form was submitted
// insert data into database
$insert = mysql_query("insert into students(SID, forename, surname, street, town, locality, postcode, hometel, mobiletel, email, course, coursestart, courseend) values ($_POST[SNo], $_POST[FName], $_POST[SName], $_POST[SAddress], $_POST[Town], $_POST[Locality], $_POST[PostCode], $_POST[HomeTel], $_POST[MobileTel], $_POST[Email], $_POST[Course], $_POST[SDate], $_POST[EDate])")
or die("Could not insert data because ".mysql_error());
echo "
";
echo "Student Created Create Another";
} else {
//form not submitted
?>
Further down the page is:
}
?>
Please help me as my damn page wont return any errors. It just doesnt blimmin work, and gives me a blank white page.
oh dear god almighty... I cannot believe such a small thing has been holding me back for the last week.
Ill leave it here for you all to try and figure out. Please bear in mind I wasnt seeing an error message, it just didnt work. :D
Please tell me thats not the code you will be using on a production system.
SQL injections anyone ?
Cornet
...oh and on first sight the problem is with this line:
echo "Student Created Create Another";
as you need to escape the quotes around ./index.php
Cornet
Quote from: cornetPlease tell me thats not the code you will be using on a production system.
SQL injections anyone ?
Cornet
rofl... no no. this is just getting on my feet stuff.
Fact of the matter is, itll be on a seperate server in my office, with 4 people who have access to the room let alone the actual software. :) SQL injections are bad, but not primary concern just at the moment.