SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    Romania, Iasi
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    img src="...php" | how is it done?

    how can i output a jpg from a php script? i know it uses something with headers but i'm not quite sure how it must be done.

    if you can provide a link to a page with a tutorial / example (or provide one) it would be great

    thank you for your time
    black diamond
    Last edited by blackdiamond; Jan 28, 2005 at 12:24.

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to provide proper content type when outputting anything other than html.
    PHP Code:
    header("Content-type: image/jpeg");
    .... 
    output your image here 
    Check this link out for further examples / explanations. imagejpeg

  3. #3
    SitePoint Member
    Join Date
    Jan 2005
    Location
    nm
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or you can just redirect to the proper image.

    PHP Code:
    header("Location image.png"); 


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
  •