Hey people
I'm in some dire need of assistance.
I am writing this small website which uses a database to store some info. Always when I call up add.php from the html file it shows every thing I've typed in the php file. I know its something small but can't seem to find the problem. Im using a MySQL database, a .php file and a .html file. Here's my code if someone can please help it would be appreciated.
---------------PHP FILE------------
<?php
$con=mysqli_connect("localhost","Martin","Martin007","NotesDB");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO Notes (ID, Subject, Name, Surname, ContactInfo, Email, Description, Format)
VALUES
('$_POST[ID]','$_POST[Subject]','$_POST[Name]','$_POST[Surname]','$_POST[ContactInfo]','$_POST[Email]','$_POST[Description]','$_POST[Format]' )";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>
-------------HTML File----------------
<html>
<body>
<form action="add.php" method="post"/>
<p>ID<input type="text" name="ID"/></p>
<p>Subject<input type="text" name="Subject"/></p>
<p>Name<input type="text" name="Name"/></p>
<p>Surname<input type="text" name="Surname"/></p>
<p>Contact Info<input type="text" name="ContactInfo"/></p>
<p>Email<input type="text" name="Email"/></p>
<p>Description of Notes<input type="text" name="Description"/></p>
<p>Printed or Written<input type="text" name="Format"/></p>
<p><input type="submit" /></p>
</body>
</html>