Any way to hide the path code?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chrisjchrisj
Forum Newbie
Posts: 5
Joined: Thu Apr 02, 2009 8:42 am

Any way to hide the path code?

Post by chrisjchrisj »

I'm using a popular php video-sharing script for my web site.
I've modded it so vistors must pay to view a video, however the path to the thumbnail appears on the html page in the View Source code, which is very similar to the path to the actual video. Is there any way to hide the path code?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Any way to hide the path code?

Post by Mark Baker »

rather than use <img src="{url_of_image}"> to display the thumbnail, where {url_of_image} is your path that you want to hide, use <img src="displayImage.php?id={id_of_image}"> where displayImage.php is a little script to read the image identified by {id_of_image} and display it. The {id_of_image} can be pretty much whatever you want, a database key, or whatever that allows the script to locate the actual image file without a user being able to see the path to the image.
Of course, you'll need to write displayImage.php yourself, but there's plenty of examples around to get you started.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Any way to hide the path code?

Post by jackpf »

Also, if you don't want people viewing your videos without paying, don't put them in a public path.
Post Reply