You are not logged in.

#1 2008-03-06 20:28:32

mrbug
Member
Registered: 2007-07-17
Posts: 221

run script/program from webpage?

I'm attempting to make a webpage that will send a text page using SNPP.
I can do it manually through telnet, so I figure that expect will be able to automate it.
The part that I need help with is connecting everything. I need to figure out
how to pass the webpage form data to a script that will create a script for expect,
and then call that created script.

Is this possible? If so, how would I go about doing it? I'm not very
well-versed in perl or php, but I can hack something out if I try hard enough.


dvdtube - download all uploads from a YouTube user and then optionally create a DVD.
(Regular version AUR link / SVN version AUR link)

Offline

#2 2008-03-06 20:43:29

TheDoctor
Member
From: Ontario, Canada
Registered: 2005-06-28
Posts: 63
Website

Re: run script/program from webpage?

you can use the php system() or exec () commands to run an external script, but it will run with the permissions of the webserver.    If you need to run it outside of the weserver account, you can pass sudo to the exec or system command. 

Check http://ca.php.net/manual/en/function.exec.php and http://ca.php.net/manual/en/function.system.php for useful code snippets, etc. 

If you want to do some really fancy programming, you could bypass the external commands, and use sockets.   See this thread here: http://www.phpbuilder.com/board/showthr … t=10268619

Offline

#3 2008-03-06 23:28:07

mrbug
Member
Registered: 2007-07-17
Posts: 221

Re: run script/program from webpage?

That's exactly what I'm looking for! I have php installed on the server, so that's no problem. As long as I can do something like this, it'll work:

exec(/cgi-bin/sendsnpp.pl $number "$message");  (syntax may not be correct...)


dvdtube - download all uploads from a YouTube user and then optionally create a DVD.
(Regular version AUR link / SVN version AUR link)

Offline

Board footer

Powered by FluxBB