SNOOPY when URL is Redirected

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
chvol
Forum Newbie
Posts: 20
Joined: Fri Apr 26, 2002 2:49 pm

SNOOPY when URL is Redirected

Post by chvol »

I am writing a program in PHP that accesses the HTML of a given URL via class SNOOPY. However, some URLs change into another one e.g. http://www.247paintball.com becomes http://www.247paintball.com/forum/index.php if you connect to it. How can I tell that this URL changes like that? I think it is called “redirecting”. Is it in the HTML? I need to know what the new URL is in order to translate HREF= into the complete URL. Charlie chvol@aol.com
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

You could play around with $_SERVER['REQUEST_URI'] abit.
User avatar
Ixplodestuff8
Forum Commoner
Posts: 60
Joined: Mon Feb 09, 2004 8:17 pm
Location: Queens, New York

Post by Ixplodestuff8 »

On the page that does the redirecting there is this line:

<meta http-equiv="Refresh" content="0; URL=forum/index.php">

What you could do is have your class find <meta> tags with the http-equiv="Refresh" and extract the redirect url.
Post Reply