[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Simple page - but Syntax Error

Posted on 2002-04-29
2
Medium Priority
?
187 Views
Last Modified: 2006-11-17
I'm a newbie - spent about 2 hours looking for the reason I get:
 
Parse error: parse error in /home/ag/netafimusa-www/PHP/AddPet.php3 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,$connection)
       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["LiteratureDescription"]}');

                             

$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>
0
Comment
Question by:aprillougheed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
axis_img earned 800 total points
ID: 6978968
Would this be the problem?

echo "The following pet has been added to the Pet
      Category: "$LiteratureDescription" ;

should be:

echo "The following pet has been added to the Pet Category: $LiteratureDescription";

You have an extra quote in there...

Let me know if the problem persists...
Barry
0
 

Author Comment

by:aprillougheed
ID: 6978984
I had found the error . . .  but thanks for your help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question