1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
<?php
//if any of the two fields is left blank, don't send data, but send an error message.
if(!($description=="") || !($URL==""))
{
//connects to database server
mysql_connect(myserver, myusername, mypassword);
//connects to the database
mysql_select_db('mydatabase');
//this is the query command to insert into the bookmark
// table the values from $description and $URL
// inside the Columns description and URL
mysql_query("insert into bookmark(description, URL) values ('$description', '$URL')");
//closes connection to database.
mysql_close();
//After the data is inserted, the browser will form a web page with
// the following information.
echo "Thanks for adding the bookmark<br>";
echo "<a href=book.php3>View BookMraks</a><br>";
echo "<a href=sendbook.html>Add Another One</a><br>";
}else{
echo "You need to go to the form: <a href=sendbook.html>Sendbook</a>";
}
?>
|