I am trying to set up a simple database driven website. For some reason, whenever I try and take info from a form and send it to a database, all I get is a blank line. I can insert fine from the command line as well as hardcoding the info into a php script. When I use a form, the data never gets passed. For the life of me I can't see why. I have simplified the code so much and still nothing. Here is the form:
<HTML>
<BODY>
<form action="entry.php" method="post">
link:<input name="bookmark" type=text>
<input type=submit value="Add Link">
</form>
</BODY>
</HTML>
And the php script:
<?
$connection = mysql_connect("localhost", name, pass) or die ("could not connect to mysql!");
mysql_select_db("links", $connection)or die("could not select database");
$query = "INSERT into data(hyperlink) VALUES ('$bookmark')";
mysql_query($query);
mysql_close($connection);
?>
I have tried just printing out the $bookmark variable. Blank. I really can't figure out what is going on here. If someone can point out my stupid mistake so I can move on, I will be eternally grateful. Thanks
Atvar
<HTML>
<BODY>
<form action="entry.php" method="post">
link:<input name="bookmark" type=text>
<input type=submit value="Add Link">
</form>
</BODY>
</HTML>
And the php script:
<?
$connection = mysql_connect("localhost", name, pass) or die ("could not connect to mysql!");
mysql_select_db("links", $connection)or die("could not select database");
$query = "INSERT into data(hyperlink) VALUES ('$bookmark')";
mysql_query($query);
mysql_close($connection);
?>
I have tried just printing out the $bookmark variable. Blank. I really can't figure out what is going on here. If someone can point out my stupid mistake so I can move on, I will be eternally grateful. Thanks
Atvar