Jump to content

[SOLVED] don't evaluate include


ratcateme

Recommended Posts

I have this script

<?php
header("Content-type: image/jpeg");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
$image = fopen("./images/{$id}.jpg","r");
while(!feof($image)){
echo fgets($image);
}
fclose($image);
?>

it use to look like this

<?php
header("Content-type: image/jpeg");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
include("./images/{$id}.jpg");
?>

but one image i tried to include contained <? so was phrased as php code i want to know if there is a quicker way to include files without them being phrased as php code even if they contain <?. or is the fopen method just as quick as include i also want a method that is easy on ram as my server is kinda low :(

 

Scott.

Link to comment
Share on other sites

Shouldn't you just be using an image tag ???

<?php
header("Content-type: image/jpeg");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
?>
<img src="/images/<?php echo $id; ?>.jpg" />

Makes more sense imo.

Link to comment
Share on other sites

but why open a image in a text editor? you've really lost me lol  :P

did you try??

when u look at it, it is made up from a bunch of characters that make no sense to use reading them but will work for a program displaying them as a image

 

Scott.

Link to comment
Share on other sites

i am making an easy to understand CAPTCHA using images like pictures of a ball, flower, homer Simpson, tree ...

then i use $_SESSION to tell display.php which image to display if i used an img tag then a script could easily tell which image is being displayed this way people cant tell which image is being displayed.

 

Scott.

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.