note 15887 deleted from ref.pfpro by jimw
| From: | jimw@php.net | Date: | Tue, 18 Dec 2001 21:02:02 +0000 |
| Subject: | note 15887 deleted from ref.pfpro by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23237@lists.php.net to get a copy of this message | ||
PART3
--------------------
function pfpro_process($transaction, $url=pfpro_defaulthost, $port=pfpro_defaultport,
$timeout=pfpro_defaulttimeout,
$proxy_url=pfpro_proxyaddress, $proxy_port=pfpro_proxyport, $proxy_logon=pfpro_proxylogin,
$proxy_password=pfpro_proxypassword)
{
if(!(is_array($transaction)))
return(NULL);
/* destruct (transaction) array into (trans) string
and dynamically add LENGTH TAGS */
foreach($transaction as $val1=>$val2)
$parmsArray[] = $val1 . '[' . strlen($val2) . ']=' . $val2;
$parmsString = implode($parmsArray, '&');
$trans = PFPRO_EXE_PATH . ' ';
$trans .= $url . ' ';
$trans .= $port . ' "';
$trans .= $parmsString . '" ';
$trans .= $timeout . ' ';
$trans .= $proxy_url . ' ';
$trans .= $proxy_port . ' ';
$trans .= $proxy_logon . ' ';
$trans .= $proxy_password;
/* run transaction, if result blank, return(NULL) */
@exec($trans, $result);
if($result[0] == NULL)
return(NULL);
/* construct (pfpro) array out of (result) string */
$valArray = explode('&', $result[0]);
foreach($valArray as $val)
{
$valArray2 = explode('=', $val);
$pfpro[$valArray2[0]] = $valArray2[1];
}
return($pfpro);
}
function pfpro_process_raw($transaction, $url=pfpro_defaulthost, $port=pfpro_defaultport,
$timeout=pfpro_defaulttimeout,
$proxy_url=pfpro_proxyaddress, $proxy_port=pfpro_proxyport,
$proxy_logon=pfpro_proxylogin,
$proxy_password=pfpro_proxypassword)
{
/* This function is as RAW as it gets ... no conversions... you are responsible for
any LENGTH TAGS to avoid potential '&' and '=' problems that may arise --
it is advisable
to simply not use this function and stick only to pfpro_process().
This function merely receives a string, processes it, and then returns a results string. */
if(!(is_string($transaction)))
return(NULL);
$trans = PFPRO_EXE_PATH . ' ';
$trans .= $url . ' ';
$trans .= $port . ' "';
$trans .= $transaction . '" ';
$trans .= $timeout . ' ';
$trans .= $proxy_url . ' ';
$trans .= $proxy_port . ' ';
$trans .= $proxy_logon . ' ';
$trans .= $proxy_password;
/* run transaction, if result blank, return(NULL) */
@exec($trans, $result);
if($result[0] == NULL)
return(NULL);
return($result[0]);
}
?>