Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   High Bandwidth Dedicated Servers   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 06-04-2004, 03:39 PM   #1 (permalink)
Inactive
 
Join Date: 06-04-04
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

Nelsobra is liked by many
htaccess - require part filename

Hi, what i'm doing, is writting a modification for Invision Power Board, that watermarks all images. The downside of this is it is easily by-passable because IPB does not do that great of job with hiding file names, so what I would like to do is use most likely a .htaccess script to require part of the filename.

So if the url to the image was http://www.site.com/forums/uploads/w...=thisimage.jpg

I would like it so that all images in my uploads directory require watermark.php?name= in the filename or it returns an error. Is this possible, and if so how?

Thanks, Nelsobra
Nelsobra is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 06-04-2004, 03:52 PM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
if the script loads them dynamically then just move them out of your /public_html/ directory..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 03:56 PM   #3 (permalink)
Inactive
 
Join Date: 06-04-04
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

Nelsobra is liked by many
no good

I think you misunderstood what I'm trying to do.

I've made it so that all images uploaded to my forum are automatically watermarked, to prevent people from stealing them, also because someone requested I make this mod for them.

BUT the problem with it is that it shows the image name at the end of the php statement, so all someone has to do is remove the watermark.php?name= bit and they can view the image without the watermark. So I want preferably a .htaccess script that requires the watermark.php.... bit on all jpg and png filenames in that directory or it won't work.
Nelsobra is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 04:14 PM   #4 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
what i would do..
change the upload to upload to like /uploads/ instead of /public_html/uploads/ and then make the thumbnail script look in /uploads/ instead too..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 04:30 PM   #5 (permalink)
Inactive
 
Join Date: 06-04-04
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

Nelsobra is liked by many
no public_html

It's not in public html. And even if it was, this doesn't solve the problem. A person can easily remove the php part, and see the original unwatermarked image.

I really don't think you understand what I'm trying to do.
Nelsobra is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 04:32 PM   #6 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
yes i do.. you want ppl to have to go through your script to view the images..
for someone to view the images without a script the pics must be in some folder after public_html/
if you moved then to somewhere outside of public_html/ a script on your server would be necessary for someone to view the pics.. thus, your watermarking php script
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 04:40 PM   #7 (permalink)
Inactive
 
Join Date: 06-04-04
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

Nelsobra is liked by many
ok

Is there anyway to do this keeping the default forum structure. I don't want to have to move my upload folder around, because that would mean I would have to modify my sql database, and correct all the file locations.
Nelsobra is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 07:11 PM   #8 (permalink)
Inactive
 
Join Date: 06-03-04
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

phpistasty is liked by many
Send a message via AIM to phpistasty
change your image locatinos to the php script, and have it call the image name from above the public directory.. thats really al l you have to do
phpistasty is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 08:14 PM   #9 (permalink)
Inactive
 
Join Date: 06-04-04
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

Nelsobra is liked by many
damn.

This isn't going the way I want it to, so is there any way I can just hash the filename say md5 hash it insert that md5 hash into another column of my ibf_posts table, and then when the url leads to the md5 hash it shows the image shown in the attach_file column which is the real image name...
Nelsobra is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 08:16 PM   #10 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
that would be way more complicated then just moving the files off the server..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-04-2004, 08:56 PM   #11 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
RewriteEngine On
RewriteRule ^/forums/uploads/watermark.php\?name=[a-zA-z0-9]\.jpg$ /forums/watermarked/$1

This essentially rewrites the URLs to
www.site.com/forums/watermarked/imagename
This hasn't been tested.. and you would need to rewrite the urls to match that style with watermarked/imagename
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How-to Save PHP's require URL bytech Coding Forum 4 07-12-2008 11:00 AM
Require drop down box selection CharlieWon Coding Forum 7 02-07-2008 04:31 PM
Spaces in the filename? istanbul Web Hosting Forum 4 05-29-2006 10:52 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 10:47 AM.
© Copyright 2008 V7 Inc