Ok, still learning....
So i wanted to se eif I could just add some data into my database...
seemed easy enough to me...or not...
I keep getting Parse Errors on Line 19
Which is:
echo ;"<form name="guestbook" method="post"
I have tried removing the ; and the echo...
where am i going wrong?
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$user="user";
$host="host";
$password="pass";
$database = "database";
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to server");
$db = mysql_select_db($database,$connection);
echo ;"<form name="guestbook" method="post" action="guestbook.php">
<p>Name:<br>
<input name="name" type="text" id="name" size="30" maxlength="30" value="$name">
<br>
Email:<br>
<input name="email" type="text" id="email" size="30" maxlength="40" value="$email">
<br>
Website:<br>
<input name="url" type="text" id="url" size="30" maxlength="25" value="$url">
<br>
Message:<br>
<textarea name="message" cols="40" rows="5" id="message" value="$message"></textarea>
<br>
<br>
<input name="submit" type="submit" id="submit" value="Submit">
<br>
</p>
</form>";
{
$query="INSERT INTO guestbook (name,email,url,message) VALUES
('$name','$email','$url','$message')";
$result=mysql_query($query)
or die ("Couldn't execute query");
echo "New Message Added";
}
?>
</body>
</html>
Just trying to create a simple guestbook, where the info is stored in the db, then retrived later on, once ive figured that out 😛