<head><title>Prov</title></head>
<body bgcolor="#ffffff">
<font size=6 face=arial>
<b>TEST</b></font><br><br>
<?php
mysql_connect("localhost", "root", "camaro12") or die ("gick inte ansluta");
mysql_select_db("person") or die ("kunde inte välja databasen");
?>
<P>Klockan är just nu:
<?
echo date("Y-m-d H:i");
?>
<form method="post" action="prov.php">
<b>Förnamn:</b> <input type="text" size="40" name="fornamn"> <br>
<input type="submit" name="submit" value="Skicka">
</form>
<?php
if ($submit)
{
mysql_query("INSERT INTO namn (fornamn) VALUES ('$fornamn')");
}
?>
</font>
</body>
What I really wonder is if something's wrong with the form, because it doesn't insert what I write in the database.
I've tried to make a variable directly and set it to something and then it writes to the database.
Thanks in advance
/Magnus