Re: PHP script as target of <a href="script here">?

From: Date: Mon, 12 May 2003 09:37:30 +0000
Subject: Re: PHP script as target of <a href="script here">?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147278@lists.php.net to get a copy of this message
Ken Tozier wrote:
I need to be able to have href links launch photoshop on a users machine and open the file referenced in the link. Is there a PHP mechanism that allows this sort of thing?
You can force the file to be downloaded by sending the header "Content-type: application/octet-stream" (Did I recall that right? Time to get some sleep.)
Basically, I'd like to embed function calls in anchor tags like so (unless there is a better way to do it) echo "<a href=open_file_with_photoshop(\"path/to/photo/file.jpg\")>Click here to open file in Photoshop</a>";
Uhhh. I don't *WANT* to use Photoshop to open your JPG. I want to use GraphicConverter. Or GIMP. :-) You can force the file to be downloaded, but forcing me to use a specific program is a Bad Idea. A) Maybe I don't have Photoshop B) Maybe I have it, but don't like it. C) Maybe Photoshop isn't even compatible with my OS.
I found the following sort of works... echo "<a href=\""; echo open_file_with_photoshop(\"path/to/photo/file.jpg\"); echo "\">"; ... but photoshop is launched when the page loads (before the user gets a chance to click the link) Subsequently, the links open the specified files as expected but the cursor doesn't recognize them as a link even though the browser renders them as normal looking <a> tags.
I won't even claim to have any idea what the heck is going on here...

« previous php.general (#147278) next »