Skipjackrick Posted January 26, 2010 Share Posted January 26, 2010 I've got an issue. I need a typical html bookmark. Example, <a href="index.php#article5">See Article 5</a> <!-- Then somewhere way down the page I have this ---> <a name="article5"></a> When I write this in PHP I get an error as expected. <?php echo " <li class='next'><a href='{$_SERVER['PHP_SELF']}#article5?currentpage=1'>First <<</a></li> "; ?> Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /development/index.php on line 2 Does anyone know how to direct the user to that article? Or how to properly use a bookmark using PHP? Link to comment https://forums.phpfreaks.com/topic/189885-html-bookmark-written-in-php/ Share on other sites More sharing options...
jl5501 Posted January 26, 2010 Share Posted January 26, 2010 try echo' <li class="next"><a href="'.$_SERVER['PHP_SELF'].'#article5?currentpage=1">First <<</a></li> '; Link to comment https://forums.phpfreaks.com/topic/189885-html-bookmark-written-in-php/#findComment-1001956 Share on other sites More sharing options...
Skipjackrick Posted January 26, 2010 Author Share Posted January 26, 2010 Ah, you've got to put the book mark at the end This works. <?php echo " <li class='next'><a href='{$_SERVER['PHP_SELF']}?currentpage=1#article5'>First <<</a></li> "; ?> Link to comment https://forums.phpfreaks.com/topic/189885-html-bookmark-written-in-php/#findComment-1001966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.