A
Anonymous
Guest
Hi,
i get an error message:
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\htdocs\additem.php on line 3
when i try to run a PHP page. Anyone know wat's wrong with this?
here's the coding:
<? php
$name=$HTTP_POST_VARS['name'];
$location=$HTTP_POST_VARS['location'];
$email=$HTTP_POST_VARS['email'];
$url=$HTTP_POST_VARS['url'];
$comments=$HTTP_POST_VARS['comments'];
$submit=$HTTP_POST_VARS['submit'];
@ $db = mysql_pconnect('host', 'usr', 'pass');
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
mysql_select_db('guestbook');
if ($submit)
{
$query="insert into guestbook(name,location,email,url,comments)
values('".$name."','".$location."',
'".$email."','".$url."',
'".$comments."')";
mysql_query($query);
echo "<h2>Thanks!</h2>";
echo "<h2><a href="view.php">View My Guest Book!!!</a></h2>";
}
else
{
include("sign.php");
}
?>
thank you!
i get an error message:
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\htdocs\additem.php on line 3
when i try to run a PHP page. Anyone know wat's wrong with this?
here's the coding:
<? php
$name=$HTTP_POST_VARS['name'];
$location=$HTTP_POST_VARS['location'];
$email=$HTTP_POST_VARS['email'];
$url=$HTTP_POST_VARS['url'];
$comments=$HTTP_POST_VARS['comments'];
$submit=$HTTP_POST_VARS['submit'];
@ $db = mysql_pconnect('host', 'usr', 'pass');
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
mysql_select_db('guestbook');
if ($submit)
{
$query="insert into guestbook(name,location,email,url,comments)
values('".$name."','".$location."',
'".$email."','".$url."',
'".$comments."')";
mysql_query($query);
echo "<h2>Thanks!</h2>";
echo "<h2><a href="view.php">View My Guest Book!!!</a></h2>";
}
else
{
include("sign.php");
}
?>
thank you!