Hello!
I have two pages. The data in "namn" is written on the second page(due to the echo), so I know the varable containts data, but it is not added to the db, just an empty row is added in the database.
Thanks in advance
Klas
Fist page:
<head> <title>First page test-a.php</title> </head>
<body>
<form method="post" action="test-b.php">
Name: <input type="text" name="namn"><br>
<input type="submit" name="submit" value="Lägg till">
</form>
</body>
Second page:
<?PHP
echo "$namn";
$link = mysql_connect("localhost")or die("Could not connect to the server!");
mysql_select_db("php", $link)
or die("Could not connect to the db !!");
$query ="INSERT INTO kompisar (namn) VALUES('$namn')";
$result = mysql_query($query)
or die("Wrong in the sql-command !");
?>