Hi all,
I have a database set up, and can hapilly add info through phpMyAdmin manually and by importing data from a file. I now want to be able to send data to my data base from a HTML form. I have followed a tutorial but still can get the thing to work. When I press submit, it goes to the Thanks your information has been sent page, but when I look at the database none of the information has gone in.
This is the code that im using, any help would be great, PS I have swapped out my database details for xxxxxx.
Cheers
Lee
------------------------>>>
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "xxxxxx", "xxxxxx");
mysql_select_db("xxxxxxxx",$db);
$sql = "INSERT INTO 'xxxxxxx' (name, desc, url) VALUES ('$name','$desc','$url')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Name of site:<input type="Text" name="name"><br>
Description:<input type="Text" name="desc"><br>
URL:<input type="Text" name="url"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>
</html>