Kez323 Posted February 19, 2014 Share Posted February 19, 2014 (edited) Hi, I need help getting this thing to work, I'm not sure on how to $_GET[] data after a fragment in the URL. I've seen it used on websites before, for example: example.com/#home?q=test A working example is: http://craftland.org/#map&p=aether This is the code I'm using for the pages: http://pastebin.com/vAHppEyr Any help would be great! Thanks, Kez. Edited February 19, 2014 by Kez323 Quote Link to comment https://forums.phpfreaks.com/topic/286319-_getq-after-a-fragment/ Share on other sites More sharing options...
Solution Ch0cu3r Posted February 19, 2014 Solution Share Posted February 19, 2014 (edited) You cant get that value in PHP, as whatever is after the # in the url it is not passed in the request to the server. What is happening in craftland is they are using jquery to get the hash, and then deciding what page load. Then the page is loaded using ajax. Edited February 19, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286319-_getq-after-a-fragment/#findComment-1469539 Share on other sites More sharing options...
Kez323 Posted February 19, 2014 Author Share Posted February 19, 2014 Is there any other ways of transferring data instead of $_GET[] or $_POST[] ? Quote Link to comment https://forums.phpfreaks.com/topic/286319-_getq-after-a-fragment/#findComment-1469554 Share on other sites More sharing options...
WebStyles Posted February 19, 2014 Share Posted February 19, 2014 It depends on what you mean by 'transferring' data... If you want to pass variables from one page to another, you can use $_SESSION to store values, you can write them to a database and read them again on the next page, you can write them to text files, etc... $_GET and $_POST are more widely used for submitting stuff through the browser, like forms a user has to fill in, etc... We could give you a much better answer if you explain exactly what you're trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/286319-_getq-after-a-fragment/#findComment-1469556 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.