I have managed to get previous and next links working on my photo gallery but need to tidy it up.
My link works when coded like this

<?
echo "<a href='" . $PHP_SELF . "?photo_id=$prev'>Previous</a>" 
?>

But when I do this I get various errors. Obviously my syntax is wrong

<?
if ($prev > 0){
echo
"<a href='" . $PHP_SELF . "?photo_id=$prev'>Previous</a>" 
}
?>

Can someone help please?

You need a semicolon after the string in echo. eg.

echo "<a...>";

.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.