Re: Double Click file to have it open in Windows Explorer
| From: | DvDmanDT | Date: | Wed, 14 May 2003 00:05:26 +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-19916@lists.php.net to get a copy of this message | ||
I accutually made it without using a server... Using PHP-CLI, a .bat file,
and redirection of the output... I later had to filter out the headers PHP
outputs but that's not a BIG problem...
"Malte" <der_diggen@gmx.net> skrev i meddelandet
news:002901c319a5$d35495a0$0200a8c0@dagegen...
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