louis_coetzee Posted June 1, 2009 Share Posted June 1, 2009 Hi, trying to get the value after the hash '#' in my url. How can I do this? javascript or php? Please help, facebook doest this when changing an image in the gallery, probably ajax, but must be php related. If possible, how? thaks. Link to comment https://forums.phpfreaks.com/topic/160463-get-from-url-please-help/ Share on other sites More sharing options...
anupamsaha Posted June 1, 2009 Share Posted June 1, 2009 Hi, trying to get the value after the hash '#' in my url. How can I do this? javascript or php? Please help, facebook doest this when changing an image in the gallery, probably ajax, but must be php related. If possible, how? thaks. See parse_url() in PHP. <?php $url = 'http://username:password@hostname/path?arg=value#anchor'; print_r(parse_url($url)); echo parse_url($url, PHP_URL_PATH); ?> Hope, this will help you. Link to comment https://forums.phpfreaks.com/topic/160463-get-from-url-please-help/#findComment-846779 Share on other sites More sharing options...
Daniel0 Posted June 1, 2009 Share Posted June 1, 2009 You can't do this using PHP. Link to comment https://forums.phpfreaks.com/topic/160463-get-from-url-please-help/#findComment-846783 Share on other sites More sharing options...
gevans Posted June 1, 2009 Share Posted June 1, 2009 When facebook do it, they use javascript. After the ajax call to get a new image they change the value after the '#' in the url so that the browser back button can still cycle through the pages, even though the page has been updated asynchronously. Have a read of this; http://ajaxpatterns.org/Unique_URLs Link to comment https://forums.phpfreaks.com/topic/160463-get-from-url-please-help/#findComment-846790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.