01-23-2008, 08:40 PM
|
#7 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by StevenF
I've wrote this PHP:
Code:
<?
$username="";
$password="";
$database="guestbook";
$yourname=$_POST['yourname'];
$email=$_POST['Email'];
$websiteurl=$_POST['website'];
$comment=$_POST['comment'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query="INSERT INTO entries (name, email, website, comment) VALUES ($username, $email, $website, $comment)";
mysql_close();
?>
That should open the connection, gather all of the data from the form and creates a query to insert that data into the forum? I'm not sure how I then go about entering that data into the database when the submit button is pressed.
|
Is there suppose to be a username and password on your database?
If you have a username and password, then you need to enter that in, otherwise username and password variables can be null
__________________
VillageIdiot can have my babbies ;d
|
|
|
|