Jump to content
  • Advertisement
Sign in to follow this  
Decrius

[PHP] Load and output image without uploading (bandwidth spending)?

This topic is 3858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a script where I have to load a certain image and than output the image, but I don't want it that the server has to upload the image and than let the user download: I want the user to just download from the original fileserver (where the image is stored). So I have: File server (images stored here) -> Script server (with the actual script) -> User Users use the image tag to load the image: <img src="site.com/myscript.php"> I thought about this for my script:
<?php
$array = array('img1.png', 'img2.png');
header("Location: othersite.com/".$array[rand(0, 1)]);
?>
That works, except that it is not random! The output is always one image and if you reload it never switches to the other one! How can I make this like I want? Thank you a lot! Decrius

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!