★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum5/HTML/001168.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  PHP
  setting headers and echoing images

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   setting headers and echoing images
gpolins
Junior Member
posted May 17, 2000 09:08 PM     Click Here to See the Profile for gpolins   Click Here to Email gpolins     Edit/Delete Message Reply w/Quote
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=/old?u=http%3A%2F%2Fmyserver.com%2Fasdf.php3%26gt&y=1999 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?

Vinay
Junior Member
posted May 18, 2000 07:53 AM     Click Here to See the Profile for Vinay   Click Here to Email Vinay     Edit/Delete Message Reply w/Quote
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

gpolins
Junior Member
posted May 18, 2000 05:26 PM     Click Here to See the Profile for gpolins   Click Here to Email gpolins     Edit/Delete Message Reply w/Quote
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.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.