SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help Grabbing IMG Generated From PHP Script?!

    Hi All,
    My work intranet has a php program that generates images with the company's stock quote. For instance, the <IMG> tag looks like this:

    <img src="..../stock_quote_img.php?ticker=xxx">

    So, when you visit the page and click on "properties" for the image, it doesn't come up as a .gif or a .jpg, it comes up as 'stock_quote_img.php'. I have tried to grab the image by following the redirect with CURL, but it doesn't work and returns only "GIF89a" plus some garbage characters (like only 6 characters though, not enough for the full image).

    I also tried to fopen and fwrite the URL hoping it would get the generated image but that generates a 0 byte image 1x1 pixel, obviously something is not getting grabbed.

    Has anyone encountered this situation and successfully grabbed the image generated by the PHP script? I can't change the intranet source as that is done in head office.

    Any suggestions would be greatly appreciated!

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2008
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe I am misunderstanding...Have you tried simply right clicking and choosing save image as? I have scripts that generate images on the fly as well, but I have no problem retrieving them should I want to save it.
    DILIGENThost.com, High-availability Canadian hosting 24/7 support
    cPanel/WHM 11 + Fantastico, PHP4&5, Private nameservers...
    Unlimited domains, Self Serve DNS, No Overselling!
    | Forum & packet loss monitoring @ Webmasters-Inside.com

  3. #3
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use Mod Rewrite.

    RewriteRule ^img/xxx/(.*)\.jpg$ stock_quote_img.php?ticker=1&img=$2 [L]

    Check my images gallery at picinet.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •