Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

HEPL | Protecting Image

images php coding issues or problems here.

Moderators: macek, egami, gesf

HEPL | Protecting Image

Postby php-vikas » Tue Jan 11, 2005 12:31 am

Hi,

I always get answered on this forum. I again expect the same.

Basically I have created a shopping cart having images of products in a folder. Suppose image folder. Now what I want to do is that I want to restrict the user from opening the image by full path.

i.e. http://site.com/product/image/product1.gif.

Recently I also study the mod_rewrite module of apache. I think this module can help me in doing the task I want to do? But frankly speaking I am not able to implement this module. I am constantly doing R&D on this module until I don’t have successes.

Meanwhile can any one suggest me, how can I achieve the task I want to do?


Thanks.

Vikas Garg
http://www.dinsol.com
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby Oleg Butuzov » Tue Jan 11, 2005 3:10 am

1) use .htaccess for deny images
2) use php script to show images

=)
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby php-vikas » Tue Jan 11, 2005 5:47 am

what should i write into the .htaccess file to deny image.

:ph34r:
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby Alexej Kubarev » Tue Jan 11, 2005 6:32 am

Here is a very good link about htaccess:

http://javascriptkit.com/howto/htaccess10.shtml

hope that helps
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby Oleg Butuzov » Wed Jan 12, 2005 1:00 am

put this .htaccess into folder with images
Code: Select all
<Files "\.(gif|png|jpg)$">
order allow,deny
deny from all
</Files>
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby php-vikas » Wed Jan 12, 2005 5:17 am

<Files "\.(gif|png|jpg)$">
order allow,deny
deny from all
</Files>

I put the above code in .htaccess folder. But it dont work. However i put the following line in .htacess file and it work.

Redirect temp /images http://www.yahoo.com/

:-? :-?
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby ruturajv » Sun Jan 16, 2005 5:26 am

To directly deny is not a good thing
The best way in your site
Check out this link

http://httpd.apache.org/docs/misc/FAQ.html#image-theft
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby php-vikas » Sun Jan 16, 2005 11:02 pm

Yes, you are right. Even my solution also not worked.

So i one again back on the mod_rewrite for solving my problem.

wish i got sucessed in implementing mod_rewrite module.

Vikas
9891459084
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.