Solved

hide the path of a video file

Posted on 2009-05-05
1
240 Views
Last Modified: 2012-05-06
we can hide exact path of a jpg file using the kind of script > ( see code )

calling the code like <img src="code.php?img=myimage.jpg" />

but how can i hide exact path of video (mpeg/mpg files) and can it work with embed code like >

<object id="MediaPlayer1"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
<BR>standby="Loading Microsoft Windows® Media Player components..."
type="application/x-oleobject" width="250" height="246"><param name="fileName" value="code.php?moviename=mymovie.mpg"><param name="animationatStart" value="true"><param name="transparentatStart" value="true"><param name="autoStart" value="false"><param name="showControls" value="true"><param name="Volume" value="-450"><embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="code.php?moviename=mymovie.mpg"> name="MediaPlayer1" width=280 height=256 autostart=1 showcontrols=1
volume=-450></object>


could it work like > code.php?moviename=mymovie.mpg ??


$base_img_dir = "uploads/images/";

$full_image=$base_img_dir.'no_image.gif';
 

if (!file_exists($base_img_dir.$_GET['img']) || $_GET['img']=="" ) {

   $full_image=$base_img_dir.'no_image.gif';

   $_GET['w']=120;

   $_GET['h']=90;

   

}

else { $full_image=$base_img_dir.$_GET['img']; }
 

list($width, $height, $type, $attr) = getimagesize($full_image);
 

switch($type){

	case "1":

	$img_in = imagecreatefromgif($full_image);

	break;

	

	case "2":

	$img_in = imagecreatefromjpeg($full_image);

	break;

	

	case "3":

	$img_in = imagecreatefrompng($full_image);

	break;

	}
 

//$img_in = imagecreatefromjpeg('spaw2/uploads/images/'.$_GET['img']) or notfound();
 
 
 

$img_out = imagecreatetruecolor($_GET['w'], $_GET['h']);

imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, imagesx($img_out), imagesy($img_out), imagesx($img_in), imagesy($img_in));
 

switch($type){

	case "1":

	header("Content-type: image/gif");

	imagegif($img_out);

	exit;

	break;

	

	case "2":

	header("Content-type: image/jpeg");

	imagejpeg($img_out,NULL, 100);

	exit;

	break;

	

	case "3":

	header("Content-type: image/png");

	imagepng($img_out);

	exit;

	break;

	}

Open in new window

0
Comment
Question by:amitbravo
1 Comment
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
The code snippet appears to be something related to resizing static images, so it is not applicable.  You would probably want something that does readfile() from a hidden source, but I must admit I have never tested such a thing.

What have you tried so far?  What kinds of results or errors did you see?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now