Re: Double Click file to have it open in Windows Explorer

From: Date: Wed, 14 May 2003 00:19:08 +0000
Subject: Re: Double Click file to have it open in Windows Explorer
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-19917@lists.php.net to get a copy of this message
On Wed, 14 May 2003 01:17:19 +0200 "malte" <der_diggen@gmx.net> wrote: > I figured out a way to do what this guy (sorry, forgot the name) intended to do. > > Its a Registry, PHP, JavaScript Combination.. > > first open regedit.exe and open the HKEY_CLASSES_ROOT tree > search for .php and note the value of that key. (in my case Maguma_Studio.PHPFile) > > now search for search for that value in the HKEY_CLASSES_ROOT tree. > When you found it, open it and the shell key underneath, create a new key > and name it execute, assign a value to it like "open from webserver" this is what > you'll see in > the context menu if you right click a php file > in the execute key you just created, create a new key and name it command (this is important) > assign something like this to it > > "C:\Programme\Internet Explorer\iexplore.exe" -nohome > "http://localhost/execute.php?path=%1" > > the first parameter is your browser executable, i don't know what the second one does, but > it works though. > The third is the file itself. > > What you gotta do now is create a file in you document root and name it execute.php > > then paste this code in it > > <html> > <head> > <title>Execute</title> > <script language="JavaScript"> > <? > $yourroot = "htdocs/"; > $path = $HTTP_GET_VARS['path']; > $path = str_replace("\\", "/", $path); > $path = str_replace("//", "/", $path); > $pos = strpos($path, $yourroot); > $pos += (strlen($yourroot)); > ?>document.location.href='<? echo > "http://localhost/".substr($path, $pos);?>'; > </script> > </head> > <body> > You probably won't ever read this... > </body> > </html> > > The last thing you gotta do is define $yourroot. So if your docRoot is > "c:\apache\somecrap\" make it $yourroot='somecrap/' > it is a slash not a backslash mind you. > > let me know if this was any help or if it doesn't work > diggn Now, I like this idea. I even start finding it useful. One could have a submenu for a right click that runs a determined (PHP, HTML) file in the web-browser at a particular host. I would get rid of any JavaScript, though. I think I will play with it ;) Thanks. -- Maxim Maletsky maxim@php.net

« previous php.windows (#19917) next »