LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Php Help!!! (https://www.linuxquestions.org/questions/programming-9/php-help-223198/)

thebover 08-27-2004 03:01 PM

Php Help!!!
 
I need to be able to execute a shell command if a mysql query is successful.

(i know of the command system() )

background:

slackware box, running mysql and apache, has no keyboard or mouse, or monitor (input is strickly barcode scanner) if the scan is sucessfull i need to print a file directly to a parallel printer attached to the server if it is unsucsessful i need the computer to beep (\a command which DOES not work for me!!!!!)

Please help!!!!

ToniT 08-27-2004 03:26 PM

\a probably doesn't work in your case, because \a causes beep on the client-end when there is a tty attached.

Use beep instead.

thebover 08-27-2004 04:17 PM

Here is the code from my php page, lynx is not running as root.

exec('/usr/bin/beep');



but will not beep when executed.
beep DOES work running as root from console,
running as another user (loged out and back in ) i get "could not open /dev/console for writing"

any advice?????

david_ross 08-27-2004 04:22 PM

Is the php scrip on the same pc as you are accessing the page from?

ToniT 08-27-2004 04:23 PM

See the README that was with the software. ;) (the beep has to be set suid-root)

thebover 08-27-2004 04:30 PM

Quote:

Originally posted by david_ross
Is the php scrip on the same pc as you are accessing the page from?
yes

thebover 08-27-2004 04:33 PM

Quote:

Originally posted by ToniT
See the README that was with the software. ;) (the beep has to be set suid-root)
AHEM
BEEP WORKS FROM SCRIPT NOW!!!!

thanks guys

now have to figure out printing


All times are GMT -5. The time now is 01:42 PM.