![]() Topic awaiting preservation: Parse error: syntax error, http://www.zend.com/zend/trick/tricks-jan-2003.php |
|
|---|---|
| Author | Thread |
|
Neurotic (0) Inmate Newly admitted From: |
posted 10-21-2007 13:31
I've been working (attempting) to work through the tutorial on building a photo album relative to http://www.zend.com/zend/trick/tricks-jan-2003.php. code: <?php
include "album_config.inc.php";
// Use Heredoc syntax to format the XHTML form
$addPhotoForm = <<< addPhotoForm
<p>Add a photo to the album</p>
<form action="addphoto.php"
enctype="multipart/form-data" method="post">
<p>
Photo:<br />
<input name="photo" type="file" />
</p>
<p>
Descriptive Title:<br />
<input type="text" name="title"
size="40" maxlength="80" value="" />
</p>
<p>
Description:<br />
<textarea name="description"
rows="3" cols="40"></textarea>
</p>
<p>
<input type="submit" value="Add photo!" />
</p>
</form>
addPhotoForm;
// If the user has submitted a file for uploading.
if (is_uploaded_file($_FILES['photo']['temp_name'])) {
# Add the photo to the MySQL database
add_photo($_FILES['photo']['name'], $_POST['title'],
$_POST['description']) or die("couldnt add photo");
# Move the photo from the temp directory to
# the images directory.
move_uploaded_file($_FILES['photo']['temp_name'],
ABSOLUTE_PATH.$_FILES['photo']['name']);
echo "<p>The photo was successfully uploaded .</p>";
}
// display the form on every page instance
echo $addPhotoForm;
?>
|
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-21-2007 13:58
$addPhotoForm = <<< addPhotoForm code: <?php
include("album_config.inc.php");
// Use Heredoc syntax to format the XHTML form
$addPhotoForm = 'addPhotoForm
<p>Add a photo to the album</p>
<form action="addphoto.php"
enctype="multipart/form-data" method="post">
<p>
Photo:<br />
<input name="photo" type="file" />
</p>
<p>
Descriptive Title:<br />
<input type="text" name="title"
size="40" maxlength="80" value="" />
</p>
<p>
Description:<br />
<textarea name="description"
rows="3" cols="40"></textarea>
</p>
<p>
<input type="submit" value="Add photo!" />
</p>
</form>
';
// If the user has submitted a file for uploading.
if (is_uploaded_file($_FILES['photo']['temp_name'])) {
# Add the photo to the MySQL database
add_photo($_FILES['photo']['name'], $_POST['title'],
$_POST['description']) or die("couldnt add photo");
# Move the photo from the temp directory to
# the images directory.
move_uploaded_file($_FILES['photo']['temp_name'],
ABSOLUTE_PATH.$_FILES['photo']['name']);
echo "<p>The photo was successfully uploaded .</p>";
}
// display the form on every page instance
echo $addPhotoForm;
?>
|
|
Obsessive-Compulsive (I) Inmate From: |
posted 10-21-2007 20:38
Thank you for your reply. quote: is referring to |
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-21-2007 20:47
Your problem is that the line in the error code is where the error is detected, |
|
Obsessive-Compulsive (I) Inmate From: |
posted 10-21-2007 23:39
Thanks a bunch Tyberius! |