note 15887 added to ref.pfpro
| From: | jason at thinkingman dot org | Date: | Sat, 06 Oct 2001 22:05:54 +0000 |
| Subject: | note 15887 added to ref.pfpro | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18650@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]);
}
?>
--
http://www.php.net/manual/en/ref.pfpro.php
http://master.php.net/manage/user-notes.php?action=edit+15887
http://master.php.net/manage/user-notes.php?action=delete+15887
http://master.php.net/manage/user-notes.php?action=reject+15887