#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    32
    Rep Power
    14
    My scenario is that I am trying to put an image on a page using php not on my server, that does not have php. I am using the tag <img src=http://myserver.com/asdf.php3> and asdf will a) read an image b) set a header("Content-type: image/gif") and c) echo the image. That works fine.
    The problem is that I also wanted to include a link based on the image (ie - dynamic, involving php). After I set the header, regular tags are ignored and I can't echo anything before a header, nor can I set a different header.
    SO my question is, does anyone know a workaround to this problem: like displaying an image on a non-server page, without setting a header, or a way to dynamical reference something? Any help is greatly appreciated and if you think you might be able to help, but don't understand my situation or need clarification, contact me.

    PS - If it can't be done with PHP, can it be done with any other language anyone knows of?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    10
    Rep Power
    0
    I see how you can set header, and send an image .. i dont understand what you mean by creating dynamic stuff ?..do you want to send an image with a text link ? .. elaborate please... how bout an HTML example of what you want to come and what your PHP script is ...

    regards,
    ------------------
    Kryogen WebHosting - powering dynamic content
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    32
    Rep Power
    14
    What I'm doing is using MySQL database to grab both the url for the image I want to grab and to grab a url for the link i want that image to be referenced to. my code goes something like this (psuedo-code)

    get image from mysql
    get url from mysql
    use readfile to get image to a variable
    set header
    set start of <a href > tag
    echo image
    set end of </a> tag

    What doesn't work is the href, because of the header. Thanks for responding and hopefully u can help.


IMN logo majestic logo threadwatch logo seochat tools logo