You are here: Re: Password protect jpgs? « PHP Programming Language « IT news, forums, messages
Re: Password protect jpgs?

Posted by Michael Vilain on 05/26/06 10:57

In article <e562u7$1sf$1@yggdrasil.glocalnet.net>,
"Garry Jones" <garry.jones@morack.se> wrote:

> I need to create a page with a password where I show photos. How do I stop
> people from accessing the jpgs directly without going through the password
> function.
>
> I am using Windows XP and have a website which supports Mysql and php.
>
> The end result should be a page where the user can type in a password and
> access a few pages of thumbnails which can be clicked for enlargements.
>
> Garry Jones
> Sweden

You might be able to put the images in a directory not directly in the
web server's document directory, then write a php page that, given the
name of the file in either a GET or POST argument will open the image
file, send the correct header, and display the image. Be sure to
properly check for path injection and non-image filenames, so they can't
display stuff they shouldn't be able to. Don't allow wildcards on
filenames.

Or stuff the image in a MySQL database BLOB and pull it out using a php
page.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация