471,316 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

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
Jul 16 '05 #1
1 4975
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


Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Mike Daniel | last post: by
2 posts views Thread by bilaribilari | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.