PHP_api接口教程(18)
发布时间:2021-06-06
发布时间:2021-06-06
}
return true; }
/*==============================================================
Function: Purpose: Input:
submit
submit an http form $URI
the location to post the data
the formvars to use.
$formvars
format: $formvars["var"] = "val"; $formfiles an array of files to submit
format: $formfiles["var"] = "/dir/filename.ext";
Output:
$this->resultsthe text output from the post
=============================================================*/
function submit($URI, $formvars="", $formfiles="") {
unset($postdata);
$postdata = $this->_prepare_post_body($formvars, $formfiles);
$URI_PARTS = parse_url($URI); if (!empty($URI_PARTS["user"]))
$this->user = $URI_PARTS["user"]; if (!empty($URI_PARTS["pass"]))
$this->pass = $URI_PARTS["pass"]; if (empty($URI_PARTS["query"]))
$URI_PARTS["query"] = ''; if (empty($URI_PARTS["path"]))
$URI_PARTS["path"] = '';
switch(strtolower($URI_PARTS["scheme"])) {
case "http":
$this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"]))
$this->port = $URI_PARTS["port"]; if($this->_connect($fp)) {