URL encoding for a streaming video in the gallery.

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
jeevanism
Forum Newbie
Posts: 14
Joined: Fri Dec 09, 2011 12:12 am

URL encoding for a streaming video in the gallery.

Post by jeevanism »

Hello All,

I need a small help. I have an application built in php which stores images and videos as in gallery. A user can click on the video , it will play as in streaming way. This part is ok. now, we have a limitation that we cannot play .vob files using our embedded player. so I just put an href tag to the location of that video thus user can download/play according to the client browser settings. this is again ok. but the issue arise , when I go for seeing source code. since href is a direct url , it shows complete path of video including all dir which is not good for security.. I am just wondering, how can I mask this?

I know URL encoding but issue is

my code for external client side video play is like this

Code: Select all

<a href ="/rootfolder/videofolder/video.vob"></a>
. from my knowledge href tag only accept non-formatted values right?/ I mean can I put some thing like this ??

<a href="#8743854358jsdsad76as"></a>.. I dont think so...am I so dump?:D

okies.. my requirement is , when client go for seeing source code, the source url of video should be masked/encrypted....any help???/


thanx
User avatar
theserve
Forum Newbie
Posts: 24
Joined: Wed Jan 18, 2012 6:35 am
Location: London

Re: URL encoding for a streaming video in the gallery.

Post by theserve »

you could probably use Apache mod_rewrite or mod_alias to manipulate the URL.
jeevanism
Forum Newbie
Posts: 14
Joined: Fri Dec 09, 2011 12:12 am

Re: URL encoding for a streaming video in the gallery.

Post by jeevanism »

theserve wrote:you could probably use Apache mod_rewrite or mod_alias to manipulate the URL.

thanx for the response.. can you elaborate a lil how to do that? I am not good with htaccess n things/
jeevanism
Forum Newbie
Posts: 14
Joined: Fri Dec 09, 2011 12:12 am

Re: URL encoding for a streaming video in the gallery.

Post by jeevanism »

I found solution from other forum.. sharing for others who in need..

<?php
$userinput = "hi.wmv";
echo '<a href="showvideo.php?video=', urlencode($userinput), '">';
?>


thanx to original poster of this code.
Post Reply