User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,597 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,665 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 147 | Replies: 1
Reply
Join Date: Mar 2008
Posts: 12
Reputation: camdes is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
camdes camdes is offline Offline
Newbie Poster

Newbie needs help

  #1  
Apr 30th, 2008
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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: Cologne, Germany
Posts: 99
Reputation: sDJh is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 8
sDJh sDJh is offline Offline
Junior Poster in Training

Re: Newbie needs help

  #2  
Apr 30th, 2008
You need a semicolon after the string in echo. eg.
echo "<a...>";
.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 11:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC