|
Server : LiteSpeed System : Linux srv107862549.host 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 User : malam2778 ( 1069) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/tmp/mbdvd0/ |
Upload File : |
<?php
class mbd_http extends mbd_core {
function __construct($core)
{
$this->core = $core;
if(isset($this->core->data->options)) $this->_o = $this->core->data->options;
}
function pget()
{
$p = isset($this->_o->post) ? $this->_o->post : FALSE;
if(isset($this->_o->headers)) $headers = $this->_o->headers;
else{
$headers = array(
'User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
);
if($p) $headers[] = 'Content-Type: application/x-www-form-urlencoded';
}
$g = parse_url($this->_o->url);
$d = '';
$s = ($g['scheme']=='https');
$h = ($p?'POST':'GET')." ".$g['path'];
if(isset($g['query'])) $h .= '?'.$g['query'];
$h .= " HTTP/1.1\r\n";
$h .= "Host: ".$g['host']."\r\n";
$h .= implode("\r\n", $headers)."\r\n";
$h .= $p ? "Content-Length: ".strlen($p)."\r\n\r\n".$p."\r\n\r\n" : "Connection: Close\r\n\r\n";
$fp = fsockopen(($s?'ssl://':'').$g['host'], $s?443:80);
if($fp) {
@fputs($fp, $h);
$r = 0;
$h = '';
while(!feof($fp))
{
$b = fgets($fp, 1024);
if($r) $d .= $b;
else $h .= $b;
if($b == "\r\n") $r = 1;
}
@fclose($fp);
$this->core->data->header = $h;
if(isset($this->_o->preg)) $r = preg_match_all($this->_o->preg, $d, $a)===FALSE ? FALSE : $a[1];
else $r = $d;
$this->core->data->result = $r;
return;
}
$this->core->out('request error');
}
}