Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
- <head>
- <title>PHP HEADER CHECKER</title>
- <meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
- <meta name="viewport" content="width=device-width,initial-scale=1">
- <b><font color="lime">Enter host or ip whose headers you want to view</font></b>
- </head>
- <style>body {
- background-color: black;
- color: #303030;
- } input, button {
- color : #00ff00;
- background-color : black;
- border : 1px solid #303030;
- } form {
- margin: 0;
- padding: 0;
- } </style>
- <form method="post">
- <input name="put" type="text" value="">
- <br/><br/>
- <input type="submit"name="get"value="Submit"/></form>
- <?php
- function parseHeaders($data)
- {
- $headers = explode("\r\n", $data);
- foreach($headers as $i => $header)
- {
- $value = explode(' ', $header);
- $key = $value[0];
- array_shift($value);
- $return[strtolower(trim($key, ':'))] = implode(' ', $value);
- }
- return $return;
- }
- function makeHeaders($headers)
- {
- foreach($headers as $key => $value)
- {
- $kalimat = strtoupper($key);
- $string .= "<b>$kalimat</b> => $value" . "<br/>";
- }
- $string .= "<br/>";
- return $string;
- }
- ?>
- <?
- function http_head_curl($url,$timeout=10)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0");
- curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_NOBODY, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $res = curl_exec($ch);
- if ($res === false) {
- echo "Your input is not valid";
- }
- return trim($res);
- }
- ?>
- <?
- if($_POST['get']){
- $pt=$_POST['put'];
- if(empty($pt)){
- echo '<font color="white"><br/>You entered is :</font> <font color="red">Empty</font>';
- }else{
- $qfs = str_replace("http://","",$pt);
- $ur = str_replace("https://","",$qfs);
- $fok = http_head_curl('http://'.$ur.'',5);
- $parts = explode("\r\n",$fok);
- $party = implode("<br/>",$parts);
- $tpl = parseHeaders($fok);
- $done = makeHeaders($tpl);
- if(preg_match("/CONTENT-TYPE/",$done)){
- echo '<font color="white"><br/>You entered is :</font><font color="lime">'.$ur.'</font><font color="white"><br/>'.$done.'</font>';
- }else{
- $uri = str_replace("=>",'<font color="white"><br/>You entered is :</font> <font color="red">'.$ur.'</font><font color="red"><br/>You entered is not valid or fraud</font>',$done);
- echo $uri;
- }
- }
- }
- ?>
- <center><font color="white">Powered by wehandler<br/>
- <?php echo ''.$_SERVER['HTTP_HOST'].' - © '.$now.''; ?></font><br/>
- </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement