LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-27-2004, 03:01 PM   #1
thebover
Member
 
Registered: Jul 2004
Location: Canada
Distribution: suse 9.1/knoppix/slackware
Posts: 60

Rep: Reputation: 15
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!!!!
 
Old 08-27-2004, 03:26 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
\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.
 
Old 08-27-2004, 04:17 PM   #3
thebover
Member
 
Registered: Jul 2004
Location: Canada
Distribution: suse 9.1/knoppix/slackware
Posts: 60

Original Poster
Rep: Reputation: 15
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?????
 
Old 08-27-2004, 04:22 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Is the php scrip on the same pc as you are accessing the page from?
 
Old 08-27-2004, 04:23 PM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
See the README that was with the software. (the beep has to be set suid-root)
 
Old 08-27-2004, 04:30 PM   #6
thebover
Member
 
Registered: Jul 2004
Location: Canada
Distribution: suse 9.1/knoppix/slackware
Posts: 60

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by david_ross
Is the php scrip on the same pc as you are accessing the page from?
yes
 
Old 08-27-2004, 04:33 PM   #7
thebover
Member
 
Registered: Jul 2004
Location: Canada
Distribution: suse 9.1/knoppix/slackware
Posts: 60

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 08:37 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
Updating php 4.3.1 from tar and keeping current php configuration with mandrake 9.1 mrjeep Linux - General 0 04-02-2003 07:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration