is it possible to redirect the requested page with php without to leave the current page or it needs javascript? I need this to pick up a cookie in background or what is the best approach to get a cookie from a third party?
Asked
Active
Viewed 195 times
-4
-
4Is it possible to leave a page without leaving it? Woah.... – SomeKittens Aug 23 '12 at 20:28
-
You can try loading the page in an iframe. – gen_Eric Aug 23 '12 at 20:28
-
2@SomeKittens - sure, haven't you heard of quantum pages? – LittleBobbyTables - Au Revoir Aug 23 '12 at 20:30
-
2not too stupid of a question, I upvoted it as it may yet be useful php newbies – user115422 Aug 23 '12 at 21:12
1 Answers
2
It's possible to dynamically load content into a page using JavaScript/jQuery. Get the content with $.ajax()
and then load the data into the selected div
(or other selector) with html()
. This way, the page stays the same (you retain cookies) but you can load additional content (rather than redirecting).

SomeKittens
- 38,868
- 19
- 114
- 143
-
okay thanks, sorry for the stupid question but thats how learn about new things – lgt Aug 23 '12 at 20:36
-
I understand. Just remember, there's no such thing as overexplaining what you want to do. You didn't have much info in your question as is. Feel free to join us in chat if you need direction, and don't forget to upvote/accept! – SomeKittens Aug 23 '12 at 20:39
-
thanks again for your feedback, the point would be that the visitor of my site to get a cookie from a third party and here I don not have any idea what would be the best approach to achieve what I want – lgt Aug 23 '12 at 20:43
-
1Like I said, check out chat: http://chat.stackoverflow.com/rooms/11/php – SomeKittens Aug 23 '12 at 20:44