Jump to content

dkintheuk

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dkintheuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So obivous couldn't see it! Cheers, Rob.
  2. Just looking for a simple way of finding out how big any array is, for instance how many elements are in it as if i have a loop adding items and then i want to work with them i'd like to know how big that array is before i start... possibly a silly question to be asking but just wondered if anyone had done the same. Cheers all.
  3. OK i'm getting somwhere now... Was going to use this code... [code] <? php $file_ref = $_REQUEST['img_ref']; if(file_exists($file_ref))         {         $tipe = getimagesize($file_ref);         $header_ext = ($tipe[2] < 4) ? ($tipe[2] < 3) ? ($tipe[2] < 2) ? ($tipe[2] < 1) ? NULL : 'gif' : 'jpeg' : 'png' : NULL;         if($header_ext !== NULL)                 {                 header("Content-type: image/" .$header_ext);                 readfile($file_ref);                 }         } ?> [/code] but it is not working as expected... I get an 'unexpected T_VARIABLE' error for the first line ($file_ref = $REQUEST['img_ref'];) Why am i getting this? i even tried a cut down version of this: [code] <? php $fileref = '/images/pic_001.jpg'; header("Content-type: image/jpeg"); readfile($fileref); ?> [/code] and it still gives the same error...
  4. So here is my next question... If I put the images in a folder outside of the web root directory, how do i access them by php script? Is there a code example of how to do this anywhere? I assume i have to use something including $_SERVER['DOCUMENT_ROOT'] but how do i refer to the image to be able to display it?
  5. How about if i put the images in an inaccessible place. i.e. my hosting has /web/ and /logs/ when i ftp to the site - if i create another directory here called /protect_images/ then how do i refer to that location from within a php script in the folder /web/? All the files in /web/ appear as valid websites and all other files are invisible to the world... Does that give me some options?
  6. Ah - then it appears that i am stuck... the problem is that i don't want people to just put in the next url number and get the next image... Can you tell i'm gonna charge for viewing them? I can understand that i can't do what i want with http integration... so how do i stop people getting to the files? Do i have to put them further up in the directory structure? what can i do to acheive this - p.s. i've sussed out the bandwidth theft bit thanks. Rob.
  7. Hi all, I'm trying to access pages, images and files in my site that are protected by http authentication. I have a php page, for instance, that will display images from the protected location, but obviously i want the page itself to access the protected location and not reveal to the user that they have obtained images from that location which are now in the webpage they are viewing. Does that make any sense? Can anyone help? Many thanks, Rob.
×
×
  • 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.