worth2talk Posted May 17, 2007 Share Posted May 17, 2007 Hi, I have been struggling and googling since last 3 hours but didn't got any useful info yet. Well, my issue is i want to pass a parameter through URL along with anchor name. But i don't find anything to achieve this. For example, i have two files as below: test1.php <?php <a href = "test2.php#section1?sid=1"> Click </a> for section 1 <a href = "test2.php#section2?sid=2"> Click </a> for section 2 <a href = "test2.php#section3?sid=3"> Click </a> for section 3 ?> test2.php <?php $sid = $_GET['sid']; echo " Section Id = $sid"; echo "<br />"; echo "<h2><a name=\"section1\">Section1</a></h2>"; echo " ..... some data "; echo "<h2><a name=\"section2\">Section2</a></h2>"; echo " ..... some data "; echo "<h2><a name=\"section3\">Section3</a></h2>"; echo " ..... some data "; ?> But unfortunately, its not working... can anyone have an idea to achieve this ?? Quick reply will be appreciated ...!! Thanks in Advance ..!! Link to comment https://forums.phpfreaks.com/topic/51904-how-to-pass-anchor-name-with-paramaters-in-url/ Share on other sites More sharing options...
quickstopman Posted May 17, 2007 Share Posted May 17, 2007 i think it might be because you have the #'s in the wrong place <?php <a href = "test2.php?sid=1#section1"> Click </a> for section 1 <a href = "test2.php?sid=2#section2"> Click </a> for section 2 <a href = "test2.php?sid=3#section3"> Click </a> for section 3 ?> Link to comment https://forums.phpfreaks.com/topic/51904-how-to-pass-anchor-name-with-paramaters-in-url/#findComment-255879 Share on other sites More sharing options...
448191 Posted May 17, 2007 Share Posted May 17, 2007 Anything behind the hash is NOT passed to the server. There is no way to do that. Link to comment https://forums.phpfreaks.com/topic/51904-how-to-pass-anchor-name-with-paramaters-in-url/#findComment-255893 Share on other sites More sharing options...
worth2talk Posted May 17, 2007 Author Share Posted May 17, 2007 heyyy quickstopman, thanks a lot.... it works....!! Link to comment https://forums.phpfreaks.com/topic/51904-how-to-pass-anchor-name-with-paramaters-in-url/#findComment-255896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.