run a script from php..

This is a discussion on run a script from php.. within the PHP Language forums, part of the PHP Programming Forums category; Hi, I would like to run a custom script on a linux box via a button on a php page (...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-29-2003
James
 
Posts: n/a
Default run a script from php..

Hi,

I would like to run a custom script on a linux box via a button on a php
page (php webpage hosted on the same linux box).

Is this possible? If so , can you give me a pointer in the right direction?

thanks
James


Reply With Quote
  #2 (permalink)  
Old 06-29-2003
Jason Dumler
 
Posts: n/a
Default Re: run a script from php..

James,

Do you mean run a custom script inside the browser's environment as the
browser's user rather than the web server's environment as the web
server's user?

Or...

Do you mean click a button in the browser window, but don't post that
page to the web server, but have the web server run a script anyway?

If it is the second one, you can do something with frames. With a
hidden iframe on your web page, you can use javascript to build a form
in that iframe, and then cause that form to post to the server. Then
the server runs the posted script.

If it is the first one, I don't think you can. Well, you could do this:
Configure your browser to run .phpsc files using the commandline php.
Write your PHP script, make sure it works, and rename it with a .phpsc
extension. When you click on the button, use javascript to fetch that
file. When the browser gets the file, it'll ask you what to do with the
..phpsc file, run it or save it. You can then run the file. You can't
use a .php extension because the server will parse the .php file and run
it, so we make up a .phpsc extension. This is obviously a single user
solution, but it will execute the script.

You could probably do something with a Java applet. If you're using
Mozilla, you could write some sort of Mozilla extension that would do
what you're looking for.

Jason

James wrote:
> Hi,
>
> I would like to run a custom script on a linux box via a button on a php
> page (php webpage hosted on the same linux box).
>
> Is this possible? If so , can you give me a pointer in the right direction?
>
> thanks
> James
>
>


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:23 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0