Jump to content

Image redirect using php?


scuff

Recommended Posts

You cannot use the header function if output has already started or sent. If you visit page2.php directly it will redirect to example.com however embedding it in an HTML page will not work.

 

 

You may want to try

 

<meta http-equiv="refresh" content="0;url=http://example.com/">

I tried putting <meta http-equiv="refresh" content="0;url=http://example"> on page2.php but it didn't work, so basically you can't redirect from img src, right?

Why are you even doing this? The image tag is for an image, if you didn't know, and the browser will only render it as so. If that would allow redirecting the bloody web would be 1000x as spammy than before.

 

Page2.php can redirect to http://www.example.com/image.jpg.

lol good just making sure for security reasons on my site :P I'm trying to disable every possible way of redirecting

 

Only thing you'd need to watch out for is XSS, which relates to problems with javascript. The IMG tag will just output a resulting image if it is supported, such as mimetype image/jpg(gif/png/xmp/)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.