Parse error: parse error, unexpected '{' in c:\appserv\www\k1\preuploa
Main Topics
Browse All Topicsi follow the following tutorial
http://www.sitepoint.com/a
--------------------------
<?php
include 'config.inc.php';
// initialization
$photo_upload_fields = '';
$counter = 1;
// If we want more fields, then use, preupload.php?number_of_fi
$number_of_fields = (isset($_GET['number_of_fi
(int)($_GET['number_of_fie
// Firstly Lets build the Category List
$result = mysql_query('SELECT category_id,category_name FROM gallery_category');
while($row = mysql_fetch_array($result)
$photo_category_list = <<<__HTML_END
<option value="$row[0]">$row[1]</o
__HTML_END;
}
mysql_free_result( $result );
// Lets build the Image Uploading fields
while($counter <= $number_of_fields) {
$photo_upload_fields .= <<<__HTML_END
<tr><td>
Photo {$counter}:
<input name="photo_filename[]"
type="file" />
</td></tr>
<tr><td>
Caption:
<textarea name="photo_caption[]" cols="30"
rows="1"></textarea>
</td></tr>
__HTML_END;
$counter++;
}
// Final Output
echo <<<__HTML_END
<html>
<head>
<title>Lets upload Photos</title>
</head>
<body>
<form enctype="multipart/form-da
action="upload.php" method="post"
name="upload_form">
<table width="90%" border="0"
align="center" style="width: 90%;">
<tr><td>
Select Category
<select name="category">
$photo_category_list
</select>
</td></tr>
<!—Insert the image fields here -->
$photo_upload_fields
<tr><td>
<input type="submit" name="submit"
value="Add Photos" />
</td></tr>
</table>
</form>
</body>
</html>
__HTML_END;
?>
--------------------------
Parse error: parse error, unexpected T_SL in c:\appserv\www\k1\preuploa
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
moreover, given you do mysql_fetch_array(), ie use an associative array in which the normal keyx are the column names (string litterals) and not 0 or 1, you are strongly encouraged to write :
<option value="{$row[0]}">{$row[1]
or
<option value="{$row['id']}">{$row
the __ doesn't mean anything in particular, it's the bit that went with it that was important:
there was this :
echo <<<__HTML_END
and it means "echo everything until you see __HTML_END".
It could just as easily have been echo<<<stop but it is usual to use __ because it's not a combination of symbols you're likely to want to use in the echo.
the .= is shorthand, instead of saying string = string.chars you use string.=chars to save repeat typing.
I hope that helps to explain a few things
Can you post the line (and surrounding context) of the parse error? I'm confused about what it refers to.
Business Accounts
Answer for Membership
by: AlNetwatchPosted on 2003-10-07 at 22:00:39ID: 9511195
Give this a go:
elds=20 elds'])) ? lds']) : 5;
) {
></tr>";
ta"
<?php
include 'config.inc.php';
// initialization
$photo_upload_fields = '';
$counter = 1;
// If we want more fields, then use, preupload.php?number_of_fi
$number_of_fields = (isset($_GET['number_of_fi
(int)($_GET['number_of_fie
// Firstly Lets build the Category List
$result = mysql_query('SELECT category_id,category_name FROM gallery_category');
while($row = mysql_fetch_array($result)
$photo_category_list = "<option value=\"" . $row[0] . "\">" . $row[1] . "</option>\n";
}
mysql_free_result( $result );
// Lets build the Image Uploading fields
while($counter <= $number_of_fields) {
$photo_upload_fields .= "<tr><td>Photo " . {$counter} . ": <input name=\"photo_filename[]\" type=\"file\" /> </td></tr><tr><td>";
$photo_upload_fields .= "Caption: <textarea name=\"photo_caption[]\" cols=\"30\" rows=\"1\"></textarea></td
$counter++;
}
// Final Output
?>
<html>
<head>
<title>Lets upload Photos</title>
</head>
<body>
<form enctype="multipart/form-da
action="upload.php" method="post"
name="upload_form">
<table width="90%" border="0"
align="center" style="width: 90%;">
<tr><td>
Select Category
<select name="category">
<?php echo $photo_category_list; ?>
</select>
</td></tr>
<!-- Insert the image fields here -->
<?php echo $photo_upload_fields; ?>
<tr><td>
<input type="submit" name="submit"
value="Add Photos" />
</td></tr>
</table>
</form>
</body>
</html>