finding the redirect url from a java script redirect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adhawk
Forum Newbie
Posts: 2
Joined: Sat Aug 30, 2008 7:31 pm

finding the redirect url from a java script redirect

Post by adhawk »

Hello All,
I am trying extract the final url from a series of redirects (including some JavaScript redirects). I am bale to handle normal redirects by using the response code. I am struck with the JavaScript redirects as I am not able to extract the redirect url. Can you please let me know if there is any way to get the redirect urls from javascript redirects? (I am using a advertisement url as test case which redirects to different content providers some of them are javascript redirects)
-Thanks in advance
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: finding the redirect url from a java script redirect

Post by andyhoneycutt »

Are you parsing this out of a file/stream or are you actually trying to follow the redirects using something like cURL?

-Andy
adhawk
Forum Newbie
Posts: 2
Joined: Sat Aug 30, 2008 7:31 pm

Re: finding the redirect url from a java script redirect

Post by adhawk »

I am using the PEAR package HTTP request to get the headers and body of a http request and parse the body for the redirect urls (or use the header location field for http respose codes > 300 & <399).
Thanks
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: finding the redirect url from a java script redirect

Post by andyhoneycutt »

Would you mind posting some code so I can play around with the problem from my end?
Post Reply