urgent Help

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
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

urgent Help

Post by karthik_vik »

Hi,

I have created a website and have huge video files. I have burned these files onto a CD ROM. Now, i want all the links on my website to point to the video in the CDROM.

the links that i created dont work when i click on them. Is there anything special that i need to do inorder to achieve this.

Thanks

karthik
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

I'm only guessing but I think you'd use your IP address, and then specify a file path. Won't work if you have a dynamic IP though and sounds dodgy as hell from a security point of view.

Do you have room on your server? I'd upload them there if so.
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

What OS. did you mount the cdrom under your www root? What error do you get.

If you can't mount the cdrom under the www root then you should be able to build a helper script to get the file and send it to the browser.
decoy1
Forum Commoner
Posts: 50
Joined: Fri Feb 21, 2003 1:33 pm
Location: St. Louis

Post by decoy1 »

I agree with the crime dog. Imagine multiple, simultaneous requests for files on a cd drive??

Put em on the server, compress them maybe?
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

hi,

thanks all for ur help. But the thing is i will be distributing the CDROM's to all my clients.

When they run the CD. it automatically opens the webbrowser to point to my site and they will be accessing most of the pages from my server.
But all the videos instead of downloading them from the server, when they click on the link to the video, it should be run off the CDROM

So, each client will have a CD with the videos in it.

This is my problem.

Karthik.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if the html pages are on the same medium (the cd) use relative paths to link the videos.
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

Hi,

Well actually, a HTML file in the server has a link to another HTML file in the CD which has the Video link which is also in the CD

Thanks

Karthik
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

pointing to the video from the page on the cd should be no problem.
Assume a page test.html in the directory /html and a video promo.mpeg in /videos , then you link the video e.g. by

Code: Select all

<html><body>
   <a href="../videos/promo.mpeg">open video</a>
</body></html>
the tricky part is to let the server-document point to test.html on the cd. E.g. I could put the CD in my DVD-drive and the uri would be file:///g:/html/test.html or I insert it in my CD-RW causing the URI to be file:///h:/html/test.html. Or I decide to watch it on the linux-box (where the cd-rom is located at /mnt/cdrom ) and so on and so on...
You might store that info for each (logged in) user on your server but if this is such a good idea... prepare yourself for non-tech users' call-backs ;)
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

Hi,

Yeah, i am doing that, i.e before the user logs in he/she has a page where they specify the CD drive that they shall be using.

I store this in the database and use it to point my HTML page to point to the HTML page in the CD ROM.

But there something of relative addressing involved in this, because if i simply say....

Code: Select all

<a href="d:/equipment/test.html">testpage</a>
the link does not seem to work. i mean when i click on it nothing happens.

By the way, I am not the root user of the server. Does that make any difference?

thanks a lot for ur advice

Karthik
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

By the way, I am not the root user of the server. Does that make any difference?
no, this is part of the client, but you have to set the used protocol. Since the document has been requested via http (and most browser implement this as default protocol) you have to explicitly change it to the local storage. Again, the first cd-rom of my windows-box is located at file:///g:/ not simply g:/ if the browser is involved.

btw: Did you consider putting a complete working (sub-)site on the CD?
It might contain a (well placed) link to your site but users would be able to view the content even without an internet connection
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

Hi,

i have tried what u had said but it still dosent work as a link..... :(

here is the code for u to look at....

Code: Select all

<?PHP
		$cfgProgDir =  'phpSecurePages/';
		include($cfgProgDir . "secure.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
		<title>Equipments</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">		
	</head>
	<body>
		<div align="left">
			<p>&nbsp;</p>
			<font color="#000000" size="2"><strong><font face="Verdana, sans-serif">Transcievers :</font></strong></font></div>
		<ul>
			<li>
				<div align="left"><font color="#000000" size="2" face="Verdana, sans-serif">
						<a href="file:///<?php echo $CDDrive ?>/Equipment/transceivers/toptic/toptic.html" target="_blank">Toptic</a>
					</font>
				</div>
			</li>
			<li>
				<div align="left"><font color="#000000" size="2" face="Verdana, sans-serif">
					<a href="file:///<?php echo $CDDrive ?>/Equipment/transceivers/tethernet/tethernet.html" target="_self">Tethernet</a></font></div>
			</li>
		</ul>
		<div align="left">
			<font color="#000000" size="2" face="Verdana, sans-serif"><strong>Switches & Hub:</strong></font></div>
		<ul>
			<li>
				<div align="left"><font color="#000000" size="2" face="Verdana, sans-serif">
					<a href="file:///<?php echo $CDDrive ?>/Equipment/switch/catalyst4005/switchcatalyst4005.html" target="_self">Catalyst 4005</a></font></div>
			</li>
		</ul>
	</body>
</html>

here the php variable $CDDrive stores the drive info.....I have also tried it without using echo

and to your other query, i cannot put the site on my CD bcoz my employers want it the other way..... :(

Anyways, thanks a ton for your help.

Karthik.
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

Hi,
Since the document has been requested via http (and most browser implement this as default protocol) you have to explicitly change it to the local storage
how do i explicitly change the protocol to local storage?

excuse me if this is very simple....i am a newbie

thanks

karthik
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

Hi,

i just tested what u had said in windows 2000 and it worked perfectly.....

but dosent seem to work in Windows XP....Know any walkaround..

Karthik
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

hm, sorry windows xp is something only others suffer from ;)
Does nothing come up or an error message of some kind?

This might a long shot but maybe using a debugger helps you by providing additional information. I guess you're testing with IE on WinXP? There was a debugger freely available at microsoft's site but since I own DevStudio for quite a while I must admit I forgot where it was located. Maybe it was in the platform sdk or this winDbg-thing from http://www.microsoft.com/ddk/debugging/
But before installing (if) note that your internet explorer then will raise a message box each time it encounters an error on a webpage and you will be amazed how many errors there are to encounter ;)
karthik_vik
Forum Newbie
Posts: 8
Joined: Thu Feb 27, 2003 5:45 pm
Location: Oklahoma

Post by karthik_vik »

Hi,

thanks for all your help. Really appreciate it. I guess i will have to deal with IE on Win XP....

Personally, i am a unix person :)

but have to deal with windows as my clients would have them...

Anyways, Thanks again.

Karthik
Post Reply