2

A client asked for a web to fax application written in php. But I have no idea how to do this.

I believe php or any other web application can't communicate with the modem directly. So there should be some sort of service or daemon handling the job and be the line between web interface and modem.

Tried googling things a bit and some words like HylaFAX and AvantFax came out. Still can't figure out.

I prefer writing the web interface myself to have custom language support and better user experience.

So in the end what I am asking is how to achieve a web to fax application from scratch. From setting up server and making the web application. Even some directions would help.

xperator
  • 437
  • 2
  • 11
  • 23

2 Answers2

2

Install HylaFAX and invoke the sendfax command-line options through PHP's exec or system calls.

Lee Howard
  • 36
  • 1
0

If your customer is flexible, DeliveryWare may be a good alternative.

Other than learning PHP, interfax looks pretty simple.

  1. For testing, follow instructions here.
  2. Once your testing complete, if you need to fax to more than one number, setup a pay account per these instructions.
  3. Also, if sensitive information (PII, CC #'s, etc) are being sent through this, be sure to use SSL.

EDIT If you don't already have a server setup, you'll probably want to go with a LAMP stack. An install of Ubuntu Server should do the trick.

Please be sure to let everyone know what solution you eventually choose. With e-mail and the invention of the google machine, I imagine there's not such a need for fax anymore.

    /**************** Settings begin **************/

    $username = ''; // Enter your Interfax username here
    $password = ''; // Enter your Interfax password here
    $faxnumber = ''; // Enter your designated fax number here in the format +[country code][area code][fax number], for example: +12125554874
    $texttofax = 'My text goes here'; // Enter your fax contents here
    $filetype = 'TXT'; // If $texttofax is regular text, enter TXT here. If $texttofax is HTML enter HTML here

    /**************** Settings end ****************/

    $client = new SoapClient("http://ws.interfax.net/dfs.asmx?wsdl");

    $params->Username  = $username;
    $params->Password  = $password;
    $params->FaxNumber = $faxnumber;
    $params->Data      = $texttofax;
    $params->FileType  = $filetype;

    $faxResult = $client->SendCharFax($params);

    print_r($faxResult);
    ?>
ZnArK
  • 629
  • 4
  • 11
  • There a few thing I need to clarify: 1. I know how to code php. 2. And I know to setup L.A.M.P 3. Using services like InterFax is not what I'm looking for. That's why I started this topic. I know php, I have server and I have the fax modem. But I don't know the tools for making the server. How should php access fax modem ? such direct access would be impossible. So there should be a package/service running on server. But what's that ? – xperator Jun 12 '12 at 18:56
  • You'll want to look into command line programs that can handle the faxing, since I highly doubt PHP can do it itself. Then use PHP's exec() or system() to run the program with the required parameters. Hopefully someone here has some command line fax experience. – KJ-SRS Jun 12 '12 at 20:52