array('name' => $name, 'type' => $type, 'tmp_name' => $tmp_name)); } break; default: break; } $fax_sent=false; $missing_number=false; $bad_number=false; $missing_file=false; $bad_file=false; $fax_not_sent=false; switch($action) { case 'send': $url=$proto.'://'.$site_host.$path; $args = array( 'to' => $to, ); $response=sendpost($url, $args, $files, true); if (!$response or $response[0] != 200) { $fax_not_sent=true; break; } $r=$response[2]; $codes=explode(';', $r); foreach ($codes as $c) { switch($c) { case OK: $fax_sent=true; break; case KO_MISSINGNUMBER: $missing_number=true; break; case KO_BADNUMBER: $bad_number=true; break; case KO_MISSINGFILE: $missing_file=true; break; case KO_BADFILE: $bad_file=true; break; case KO_FAXNOTSENT: default: $fax_not_sent=true; break; } } break; default: break; } ?>