Need help creating dynamic script.

Title is vague. Read inside for the details

Page 1 of 1

2 Replies - 451 Views - Last Post: 30 December 2008 - 09:42 AM Rate Topic: -----

#1 mjmorrell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-December 08

Need help creating dynamic script.

Posted 26 December 2008 - 01:13 PM

Hey everyone, I am trying to make a script that will work something like this:

1. User requests "img.mysite.com/hi.gif"
2. img.mysite.com will then go to "google.com/hi.gif" and it will output the image.

I have the proxy part of it down but I need help getting the script to read the "hi.gif".
Could anyone help me?
Is This A Good Question/Topic? 0
  • +

Replies To: Need help creating dynamic script.

#2 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: Need help creating dynamic script.

Posted 26 December 2008 - 06:02 PM

I think I could probably help you, but you're going to have to be a bit more clear. I'm not entirely sure I know what you're trying to accomplish.
Was This Post Helpful? 0
  • +
  • -

#3 mazeroth  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 29
  • Joined: 11-December 08

Re: Need help creating dynamic script.

Posted 30 December 2008 - 09:42 AM

Here's a quick example of what I think you are trying to do:

<?php 

$img = $_REQUEST['img'];
header('Content-type: image/gif');
print file_get_contents('http://www.google.com/'.$img);

?>



To test you would go to:
http://your.server.c...images/logo.gif

This would return to the browser:
http://www.google.co...images/logo.gif

This post has been edited by mazeroth: 30 December 2008 - 09:43 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1