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? Quote Link to comment 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> '; Quote Link to comment 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> "; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.