Log in

View Full Version : Using php to hide video embed urls?



Bluz
05-18-2008, 07:26 PM
I'm looking for a way to hide embeded videos urls completely. I've found one script that lets you do it with a data base but it was very very pricey. What it does though is runs the video through a embeded player on my site instead of theres and encrypts the url using xml I believe. If anyone knows of a script out there thats cheap or if you can help me please let me know.

I would also be willing to pay someone to do this for me.

Jas
05-19-2008, 03:12 AM
How much do you know about PHP and MySQL? It wouldn't be too hard to create-- I've done it already, myself.

What you do is something like this:
Store an ID and location in a MySQL databse (or a flat file)
Put all videos in a folder with an .htaccess file that blocks access to all contents in the folder for everyone
Create a php script that reads in a particular file and then outputs it

So, for example, instead of the embedded file source being www.mysite.com/files/movie.avi the url is www.mysite.com/download.php?file=1
download.php would find the entry in the MySQL databse with an ID of 1, grab the associated location, and then read in the file at that location and output it as though it were actually the file. You player won't know the difference, and neither will the user.
You can also put some security in the PHP file, so that only users who are logged in can access the files.

parthatel
07-25-2008, 07:57 PM
How would you do the "Store an ID and location in a MySQL databse (or a flat file)" like in the example above?

benslayton
07-25-2008, 09:52 PM
How would you do the "Store an ID and location in a MySQL databse (or a flat file)" like in the example above?


well if you are using a flatfile you could do one of two things.. store the data in your flat file like this:

25||/videos/cars.avi
25 being the ID and /video/cars.avi being the location of the video..
use php's explode() function to split the two up..

or you could just have ID numbers by the row in the text file.. But I and I am sure most people would recommend you using the explode() function..

If using MYSQL just add a column with IDs and a column for fileNames. Simple as that.