Jump to content

Saving show.php as a .jpg?


bastband

Recommended Posts

Well, I don't quite know what you mean with saving show.php as a JPEG. Do you want show.php to output a picture (a JPEG)?

 

Try this:

 

<?php
// do some stuff here to determine the path of the image on the server - for this example we'll just set it like this:
$img_path = "/home/somebody/images/test.jpg"; // note that this is outside the document root in this example

header("Content-type: image/jpeg"); // here we tell the browser that it is a jpeg
@readfile($img_path); // here we read the contents of the file and output it
die();
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.