Get Dynamic URL

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi.  I have a dynamic URL (e.g. ) that
redirects to a specific image file ( under certain circumstances.  Does
anyone have any ideas how I can get that final image filename using
PHP so I can do an if statement (e.g. If filename = 1.gif { do this }
else { do this })

Any ideas are welcome!!


Re: Get Dynamic URL

Quoted text here. Click to load it

Presumably without fetching the final file itself? Use Curl, tell it
not follow the forwards, keep calling it with the redirected address
until it points to something where parse_url() gives you something
like the filename you are looking for.

Was that hard?


Re: Get Dynamic URL

Joseph Gruber wrote:
Quoted text here. Click to load it

I guess I don't understand.  You want to get the filename without
fetching it?  You can do that if the file is in your system with the
file system functions.  But if the file is on another site, you won't be
able to check if it exists in PHP without fetching it.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline