Domain Empire

[PHP]Identical Downforeveryoneorjustme php script with htaccess for nice links

Spaceship Spaceship
Watch
Impact
1,418
Identical Downforeveryoneorjustme php script with htaccess for nice links.

index.php

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Down for everyone or just me? | Clone</title> 
	<style type="text/css">
	body{background-color:#fff;color:#333;font-family:Arial,Verdana,sans-serif;font-size:62.5%;margin:10% 5% 0 5%;text-align:center;}
    a,a:visited,a:active{color:#0080ff;text-decoration:underline;}
    a:hover{text-decoration:none;}
    input[type=text]{border:1px solid #ccc;color:#ccc;font-size:1em;padding:4px 6px 4px 6px;}
    .domain{font-weight:bold;}
    a.adlink{color: orange;}
    #container{clear:both;font-size:3em;margin:auto;}
    #domain_input{width:250px;}
    #coupon{font-size: 0.4em;}
	</style>
    <script type="text/javascript"> 
    function clearDomainInput(e) {
      if (e.cleared) { return; }
      e.cleared = true;
      e.value = '';
      e.style.color = '#000';
    }
    function formSubmit() {
      domain = document.getElementById('domain_input').value;
      window.location = domain;
      return false;
    }
    </script> 
  </head> 
<body>
<div id="container"> 
<?php
$domain = "http://".$_GET['domain'];
$check =$_GET['domain'];
if ($check  == ""){
?>
<form method="get" name="downform" onsubmit="return formSubmit()"> 
  Is
  <input type="text" name="domain" id="domain_input" value="gagz.net" onclick="clearDomainInput(this);" /> 
  down for everyone
  <a href="#" onclick="formSubmit();">or just me?</a> 
  <input type="submit" style="display: none;" /> 
</form> 
<?php 
}else{
function chkServer($host, $port) 
{   
    $hostip = @gethostbyname($host); // resloves IP from Hostname returns hostname on failure 
    
    if ($hostip == $host) // if the IP is not resloved 
    { 
?>
Huh?  <?php echo $host;?> doesn't look like a site on the interwho.
<p><a href="/">Try again?</a></p>
<?php
    } 
    else 
    { 
        if (!$x = @fsockopen($hostip, $port, $errno, $errstr, 5)) // attempt to connect 
        { 
?>It's not just you!  <a href="http://<?php echo $host;?>" class="domain"><?php echo $host;?></a> looks down from here.
<p><a href="/">Check another site?</a></p> <?php 
        } 
        else 
        { 
?>
It's just you.  <a href="http://<?php echo $host;?>" class="domain"><?php echo $host;?></a> is up.
<p><a href="/">Check another site?</a></p>
<?php 
            if ($x) 
            { 
                @fclose($x); //close connection 
            } 
        }  
    } 
} 
chkServer("$check", "80");
  
}
?>
</div>
</body> 
</html>

.htaccess

Code:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteRule (.*) index.php?domain=$1 [QSA,L]

Enjoy! :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
If I were you, I would get rid of both of those options there, since they aren't needed for the script and only open vulnerabilities. Other than that, I would propably use curl, it's faster and I do validity checks on the domain before it runs through. Alot of issues here, though you have the general idea of it.

---------- Post added at 07:01 PM ---------- Previous post was at 06:59 PM ----------

Did you make this yourself though?
 
0
•••
Yes and I see what is happening here, you have one for sale and you think that no one will buy it anymore because I posted this. :) Don't worry, if yours is better than this, they will buy.
 
0
•••
No, it's not that. Though, it is because of my script that I learnt how to make an awesome clone ;)

No, I was just offering some feedback for you. I'm not that much of a jerk.

---------- Post added at 07:45 PM ---------- Previous post was at 07:42 PM ----------

But really, get rid of those two Options from the .htaccess file. It opens up vulnerabilities as Indexes enables viewing everything in that directory and you don't really need to follow symbolic links since it's a one file script.
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back