0

I want to redirect the user to a certain page within the Login-area of my page. The problem is, i dont know how to acccess the page i want to be redirected to, after the login page. The Network-Section of firebug (see picture) tells me, the page gets the GET-request, but how can i access it and extract the redirect-url?

Firebug Network-Section

I tried the code from this Question but i wouldnt work. The first example (trying to access it via fwrite($sock, $request);) tells me, that my request is a "bad request".

On the Second example, trying to extract the header via $headers = get_headers($url, 1); my page doesnt load anymore. I learned, that this happens because its a recursive function, but i have no idea how to solve the problem.

I hope my question is fairly understandable and anyone can help me!

Community
  • 1
  • 1
LocalHorst
  • 1,048
  • 2
  • 11
  • 24
  • Just to clarify you know the URL and you are unable to get the that page? – SNAG Jun 26 '14 at 10:21
  • Sorry, if that was unclear! Well, i know the url of the page i am landing, the login page. What id like to know is the url of the page i want to be redirected to after the login. The problem is like that: The user finds a link that would lead him to a page within the login area (on the graphiic its called "Mitgliederkarte"). When he's not logged in, he is directed to the login page first. After he loged in, i want to redirect him to the desired page ("Mitgliederkarte"). So i want to know the url to "Mitgliederkarte" ON the login page for creating the redirect link. – LocalHorst Jun 26 '14 at 10:36
  • Oh ok. you can try to change your code so that the return URL is in the login url. for example you try to go to www.mysite.com/mitgliederkarte you will be redirected to www.mysite.com/login?return_url='mitgliederkarte' instead of just www.mysite.com/login – SNAG Jun 26 '14 at 10:55
  • Thats probably the best solution.. Although the project is huge and i am completely new to it ;) But i'll try. Thanks a lot! – LocalHorst Jun 26 '14 at 11:00

0 Answers0