NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page [PHP]Identical Downforeveryoneorjustme php script with htaccess for nice links

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
6 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 05-07-2011, 12:07 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
cipcip's Avatar
Join Date: Mar 2007
Location: Constanta, Romania
Posts: 502
cipcip is just really nicecipcip is just really nicecipcip is just really nicecipcip is just really nice
 



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


Identical Downforeveryoneorjustme php script with htaccess for nice links.

index.php

PHP Code:
<!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);" /> 
????: NamePros.com http://www.namepros.com/code/713900-php-identical-downforeveryoneorjustme-php-script-htaccess.html
  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$errstr5)) // 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!
__________________
Social networking aggregator
cipcip is offline  
Old 05-07-2011, 02:01 AM   #2 (permalink)
NamePros Member
Join Date: Jun 2010
Location: Australia
Posts: 32
meblake will become famous soon enoughmeblake will become famous soon enough
 




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?
__________________
meblake is offline  
Old 05-07-2011, 02:32 AM THREAD STARTER               #3 (permalink)
NamePros Regular
 
cipcip's Avatar
Join Date: Mar 2007
Location: Constanta, Romania
Posts: 502
cipcip is just really nicecipcip is just really nicecipcip is just really nicecipcip is just really nice
 



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.
__________________
Social networking aggregator
cipcip is offline  
Old 05-07-2011, 02:45 AM   #4 (permalink)
NamePros Member
Join Date: Jun 2010
Location: Australia
Posts: 32
meblake will become famous soon enoughmeblake will become famous soon enough
 




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.
__________________
meblake is offline  
Closed Thread


LinkBacks (?)
LinkBack to this Thread: http://www.namepros.com/code/713900-php-identical-downforeveryoneorjustme-php-script-htaccess.html
Posted By For Type Date
Raimu Script » [PHP]Identical Downforeveryoneorjustme php script with htaccess &#8230; This thread Refback 10-05-2011 08:34 AM
GetNulled » [PHP]Identical Downforeveryoneorjustme php script with htaccess &#8230; This thread Refback 08-06-2011 03:44 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 07:41 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger