aprillougheed
asked on
Simple page - but Syntax Error
I'm a newbie - spent about 2 hours looking for the reason I get:
Parse error: parse error in /home/ag/netafimusa-www/PH P/AddPet.p hp3 on line 34
for the page:
<html>
<head>
<title>Add Pet</title>
</head>
<body>
Catalog:<br>
<ul>
<?php
$user="ag";
$host="localhost";
$password="";
$database = "netafimusa_com";
$connection = mysql_connect($host,$user, $password)
or die ("couldn't connect to server");
$db = mysql_select_db($database, $connectio n)
or die ("Couldn't select database");
$label_array = array ("LiteratureDescription" => "Literature Description");
//Loop through the values
foreach ($HTTP_POST_VARS as $key => $value)
//missing curly bracket
{
$query = "INSERT INTO tblLiteratureRequested
(LiteratureDescription) VALUES ('{$label_array["Literatur eDescripti on"]}');
$result = mysql_query($query)
or die ("Couldn't execute query.");
echo "The following pet has been added to the Pet
Category: "$LiteratureDescription" ;
}
//Close the loop
?>
<!-- Close your list and html -->
</ul>
</body>
</html>
Parse error: parse error in /home/ag/netafimusa-www/PH
for the page:
<html>
<head>
<title>Add Pet</title>
</head>
<body>
Catalog:<br>
<ul>
<?php
$user="ag";
$host="localhost";
$password="";
$database = "netafimusa_com";
$connection = mysql_connect($host,$user,
or die ("couldn't connect to server");
$db = mysql_select_db($database,
or die ("Couldn't select database");
$label_array = array ("LiteratureDescription" => "Literature Description");
//Loop through the values
foreach ($HTTP_POST_VARS as $key => $value)
//missing curly bracket
{
$query = "INSERT INTO tblLiteratureRequested
(LiteratureDescription) VALUES ('{$label_array["Literatur
$result = mysql_query($query)
or die ("Couldn't execute query.");
echo "The following pet has been added to the Pet
Category: "$LiteratureDescription" ;
}
//Close the loop
?>
<!-- Close your list and html -->
</ul>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER