By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,997 Members | 1,470 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,997 IT Pros & Developers. It's quick & easy.

run a script from php..

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.