|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Help with making script output right content type
Ok I'll try to explain what I want here, I'll give an example of what I want, say you have a site with a picture on it like <img src="http://blabla.com/a.jpg"> but instead of having a link to that image, you want to have a like to a script (php, cgi, py) whatever, and that script stills makes the "img" tag print the picture. My question is how does that script output the right info for the "img" tag so that <img src="http://blabla.com/a.php"> still prints an image. I saw a CGI script of this that does this and I tried to re-create it in other scripting languages but it doesn't work because I don't know what to make the script output. I tried making print out the link of the image but when I put the script link into the image tag all it returns is a red X. I hope I explained this right. thanks for any help.
|
|
#2
|
|||
|
|||
|
Well, you'll need to set a content type header:
header ("Content-type: image/jpeg"); Here's an interesting script. It generates a barcode. http://www.hotscripts.com/Detailed/7376.html Cool thing though, you can pass it query string parameters . <IMG SRC="barcode.php?barcode=123456&width=320&height=200">
__________________
-james |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Help with making script output right content type |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|