Friday 15 August 2014

Having issue with PHP URL Redirect Between Multiple Domains -


I have a lack of PHP skills and I have tried to troubleshoot this problem for a while and answered with no luck Have not searched. .. and I'm sure this is something easy.

I have a page on a domain that is checking to see if a cookie exists, and if it is not, then it sends a completely different domain to the user at birth date. Once they enter it and enter it for more than 21 years, they take it back to the original domain, but for some reason my script is not the whole thing, only on the sub-directory of the reference domain Occupation Defense is doing.

Then, the user goes to a fictional URL, abc.com, on the following page:

  & lt ;? Php function over21 () {session_start (); $ REDIRECT_URL = 'http: //xyz.com'; $ Valid = false; If (! $ ($ _COOKIE ["over21"])) {$ validated = true; } If (! $ Valid and released ($ _ session ['over21'])) {$ validated = true; } If ($ valid) {return; } And {$ redirect_url = $ redirect_url} "? Return =". $ _ Server ['REQUEST_URI']; Header ('Location:' $ Redirect_url); Exit (0); }} Over 21 (); ? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Abc.com page & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; Before you can read this content, you will be taken to xyz.com to validate your age & lt; / Body & gt; & Lt; / Html & gt;   

So far so good, now they are sent to xyz.com to enter the date of birth:

   = 21) {Setsuke ("over 21", $ value, time (+ 3600 * 24); $ _SESSION ['over21'] = 1; ? $ = Isset ($ _ receive ['return']) urldecode ($ _ receive ['return']) redirect: './'; Header ("Location:". $ Redirect); Go out; } And {$ _SESSION ['under21'] = 0; Header ("Location: http://google.com"); Go out; }}? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; This is xyz.com & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form & gt; Here is a form with input and to collect such days, months and years of birth. & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

If I have an age verification piece and reference page on the same domain then the script is doing a great job. But how can I modify it so that the age verification page belongs to the domain of reference Capturing full URL, not just subdomain?

Therefore, I think ignoring the same basic comment, just by looking at the session start code, It seems that you were trying to share a session across the domain.

See what you are asking only about me.

'REQUEST_URI' - given the URI to access this page; For example, '/index.html'

Try the HTTP_HOST instead.

similarly:

No comments:

Post a Comment