Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trouble exec() with HylaFax

0 views
Skip to first unread message

Eric Presley

unread,
Nov 22, 2002, 5:11:47 PM11/22/02
to
Here is my problem, I'm trying to send a fax using HylaFax fax server.
sendfax is used to send fax requestes to the server. When I try

exec ("sendfax -d 555-1212 /path/to/faxfile.txt");

it workes fine, but when I try

$comand = "sendfax -d 555-1212 /path/to/faxfile.txt";
exec ($comand);

it won't work, or if I try to use a variable in the first example (like
for the phone #) it won't work. I'm stumped, although thats not saying
much since I am fairly new to this. Any infromation is greatly
apprciated.

Thanks for the help

Ian.H

unread,
Nov 22, 2002, 5:19:30 PM11/22/02
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In a fit of excitement on Fri, 22 Nov 2002 22:11:47 GMT, Eric Presley
<er...@presleydesign.com> managed to scribble:

my $command = `sendfax -d 555-1212 /path/to/faxfile.txt`;

will execute the command and store the returned output in $command.

Even if your method did work, you'd be rteying to execute the output of
the command, not the actual command.

HTH.


Regards,

Ian

-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.3

iQA/AwUBPd6tv2fqtj251CDhEQLMYQCghPrjoAVYebDNGSOHy+Ea99aBUsUAnjnR
bBSjQdjVHGWWOjHiQFkrKPMN
=DaTN
-----END PGP SIGNATURE-----

--
Ian.H (Design & Development)
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.

Eric Presley

unread,
Nov 22, 2002, 7:00:36 PM11/22/02
to
I sorry, I guees I was very clear on what I was trying to do (that or I
don't understand you explination), my fault. When I execute the command
as a straight command it works fine but I need to be able to make the
phone number a variable. Problem is when I use a variable for the number
like

exec ("sendfax -d ".$phone." file.txt");

it wont work, where

exec ("sendfax -d 555-1212 file.txt");

workes

I tried system(), passthru(), `command` and same problem with all

thanks

Michael Mauch

unread,
Nov 24, 2002, 8:04:18 AM11/24/02
to
Eric Presley <er...@presleydesign.com> wrote:
> I sorry, I guees I was very clear on what I was trying to do (that or I
> don't understand you explination), my fault. When I execute the command
> as a straight command it works fine but I need to be able to make the
> phone number a variable. Problem is when I use a variable for the number
> like
>
> exec ("sendfax -d ".$phone." file.txt");
>
> it wont work, where
>
> exec ("sendfax -d 555-1212 file.txt");
>
> workes
>
> I tried system(), passthru(), `command` and same problem with all

Is there anything in your web server's log file? Are you sure that your
$phone really contains the phone number (try printing $phone)? Also try
printing the return value of exec() and the third parameter
(return_var), maybe it is telling you what it doesn't like.

Regards...
Michael

0 new messages