seaweed Posted March 12, 2009 Share Posted March 12, 2009 After executing a script I want to re-route the user back to the page they were on, but jump down to a specific part of the page. What is the syntax to add an anchor to the end of a php url? Right now I have: header("Location: project.php); exit; Basically I want it to be: header("Location: project.php#$panel"); exit; where $panel is the specific part of the page they were on. The page uses anchor tags like <div id="part1"> etc. Link to comment https://forums.phpfreaks.com/topic/149148-solved-header-redirect-using-anchor/ Share on other sites More sharing options...
jackpf Posted March 12, 2009 Share Posted March 12, 2009 header("Location: project.php#$panel"); exit; Why would that not work? Link to comment https://forums.phpfreaks.com/topic/149148-solved-header-redirect-using-anchor/#findComment-783152 Share on other sites More sharing options...
seaweed Posted March 12, 2009 Author Share Posted March 12, 2009 I don't know but it doesn't but this does $url = "project.php#" . $p; // Routes to project header("Location: $url"); exit; Link to comment https://forums.phpfreaks.com/topic/149148-solved-header-redirect-using-anchor/#findComment-783175 Share on other sites More sharing options...
seaweed Posted March 12, 2009 Author Share Posted March 12, 2009 Sorry... $p = $_GET['p']; came from ther page they were on and is the section they were at. How do I mark topics solved here, there's no edit post option :-\ Link to comment https://forums.phpfreaks.com/topic/149148-solved-header-redirect-using-anchor/#findComment-783178 Share on other sites More sharing options...
jackpf Posted March 12, 2009 Share Posted March 12, 2009 Well, I see you got it working and you found the topic solved link. Great success Link to comment https://forums.phpfreaks.com/topic/149148-solved-header-redirect-using-anchor/#findComment-783283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.