Home > Article > Backend Development > PHP fake source information instance method
This article mainly shares with you the example method of forging source information in PHP. This article mainly shares it with you in the form of code. I hope it can help you.
function getUrl($address, $myip) { ob_start(); $mtime = explode(' ', microtime()); $starttime = $mtime[1] + $mtime[0]; $onoff = (function_exists('ini_get')) ? ini_get('register_globals') : get_cfg_var('register_globals'); if($onoff != 1) { @extract($_POST, EXTR_SKIP); @extract($_GET, EXTR_SKIP); } $self = $_SERVER['PHP_SELF']; $myaddress = 'http://'.$_SERVER['HTTP_HOST'].$self; $comm = ''; if(isset($url) && $url) { $url = str_replace($address, '', $url); } $pcomm = ''; foreach($_POST as $key => $val) { if($pcomm == '') { $pcomm .= $key.''.urlencode($val); } else { $pcomm .= $pcomm.'&'.$key.'='.urlencode($val); } } foreach($_GET as $key => $val) { if($key != 'url') { if($comm == '') { $comm = $key.'='.rawurlencode($val);
Related recommendations:
referer PHP fake referer example code
php fake referer Use referer to prevent image hotlinking
The above is the detailed content of PHP fake source information instance method. For more information, please follow other related articles on the PHP Chinese website!