Making PHP insert code in the same page with the html code...
hey, I want to know whether it's possible to write your PHP insert code together with your HTML code where your forms are created...... what I mean is something like this:
Code:
<?php
//code for inserting the data found in the forms from the html code below
?>
<html>
<head>
<title> Inserting data from forms to the database</title>
</head>
<body>
<form action="nextpage.php" method="POST">
//input tags
</form>
</body>
</html>
You know, I tried this one but when I checked out my database after executing this, nothing has been added to my database... But I saw some of my classmates having this kind of codes... I've already asked them, but they cannot explain to me why... I feel like, this kind of code will not work if I'm the one who's gonna write it... please help... T_T