Page 1 of 1

View Album error within code

Posted: Sun Oct 30, 2011 9:46 pm
by lsecrease
I've written code to view an album and I continue to get the following error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/pichurz/public_html/view_album.php on line 26

For some reason I cannot find the error. Is there something I'm missing? Here's the script:

view_album.php

Code: Select all

error_reporting (E_ALL ^ E_NOTICE);
session_start();
$user_id = $_SESSION['user_id'];
$email = $_SESSION['email'];
include 'connect.php';
include 'func/album.func.php';
include 'func/image.func.php';

if (!isset($_GET['album_id']) || empty($_GET['album_id']) || album_check($_GET['album_id']) === false) {
	header('Location: album.php');
	exit();
}

$album_id = $_GET['album_id'];
$album_data = album_data($album_id, 'name', 'description');

echo '<h3>', $album_data['name'], '</h3><p>', $album_data['description'], '</p>';

$images = get_images($album_id);

if (empty($images)) {
	echo 'There are no images in this album';
	} else {
	foreach ($images as $image) {
		echo '<a href="uploads/', $image['album'], '/', $image['id'], '.', $image['ext']'"><img src="uploads/thumbs/', $image['album'], '/', $image['id'], '.', $image['ext'], '" alt="" /></a> [<a href="delete_image.php?image_id=', $image['id'],'">x</a>]';
	}
}


Re: View Album error within code

Posted: Sun Oct 30, 2011 9:47 pm
by lsecrease
Line 26 is:

Code: Select all

echo '<a href="uploads/', $image['album'], '/', $image['id'], '.', $image['ext']'"><img src="uploads/thumbs/', $image['album'], '/', $image['id'], '.', $image['ext'], '" alt="" /></a> [<a href="delete_image.php?image_id=', $image['id'],'">x</a>]';

Re: View Album error within code

Posted: Sun Oct 30, 2011 10:11 pm
by Celauran
Looks like you forgot a concatenator.

Code: Select all

echo '<a href="uploads/', $image['album'], '/', $image['id'], '.', $image['ext'], '"><img src="uploads/thumbs/', $image['album'], '/', $image['id'], '.', $image['ext'], '" alt="" /></a> [<a href="delete_image.php?image_id=', $image['id'],'">x</a>]';