PHP fake source information instance method

小云云
Release: 2023-03-21 11:50:01
Original
1614 people have browsed it

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);
Copy after login

Related recommendations:

referer PHP fake referer example code

php fake referer Use referer to prevent image hotlinking

PHP fake referer example code

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!