Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

php coding help

Status
Not open for further replies.
Joined
Jan 21, 2010
Posts
231
Reaction score
1
hi i am making a little script for myself to find domain renewal date, and wondered if anyone had and small cut and paste from a script they could give me that does just this.

Thanks
 
PHP Code for grabbing IPS TAG...easy switch to get Date

This is a part of a script that i wrote where you can dump in a list of domains or keywords (if it's keywords it'll remove spaces and switch it to .co.uk and .com) it'll then go fishing to see if it's been registered or not. This part of the script opens up a the uk nic page and grabs the IPS tag and updates the database.

Code:
<?php require_once('Connections/db_conn.php'); ?>
<?php
mysql_select_db($database_domains_conn, $domains_conn);
$query_getdomains = "SELECT * FROM domains WHERE  domains_id = ".$_GET['did']."";
$getdomains = mysql_query($query_getdomains, $domains_conn) or die(mysql_error());
$row_getdomains = mysql_fetch_assoc($getdomains);
$totalRows_getdomains = mysql_num_rows($getdomains);
?>
<?

do {
$domainTypeUK = preg_match("(.co.uk)", $row_getdomains['domains_domain']);
$domainsTypeOther = preg_match("(.com)", $row_getdomains['domains_domain']);
if ($domainTypeUK == 1) 

{
$file = file_get_contents("http://webwhois.nic.uk/cgi-bin/whois.cgi?query=".substr($row_getdomains['domains_domain'],11)."&WHOIS+Submit.x=0&WHOIS+Submit.y=0");
$desc = preg_match("[Tag = (.*)]", $file, $fulldesc);
$ipstag = $fulldesc[1];
$ipstag = str_replace(']', '', $ipstag);
$ipstag = str_replace('[', '', $ipstag);

//echo $fulldesc[1];

$UpdateSQL = "UPDATE domains SET domains_a = '$ipstag' WHERE domains_id = ".$row_getdomains['domains_id']."";

mysql_select_db($database_domains_conn, $domains_conn);
$Result1 = mysql_query($UpdateSQL, $domains_conn) or die(mysql_error());	

if($fulldesc[1] == "") {

echo $row_getdomains['domains_domain']." is avaialble!";

}else{

echo "Domain: ".$row_getdomains['domains_domain']." /n IPS Tag was: ".$row_getdomains['domains_a']." /n IPS Tag is now: ".$ipstag;		
}

}

else if ($domainsTypeOther == 1)

{

$file = file_get_contents("http://reports.internic.net/cgi/whois?whois_nic=".substr($row_getdomains['domains_domain'],11)."&type=domain");
$desc = preg_match("(Registrar:(.*\s))", $file, $fulldesc);

//echo $fulldesc[1];

$UpdateSQL = "UPDATE domains SET domains_a = '".$fulldesc[1]."' WHERE domains_id = ".$row_getdomains['domains_id']."";

mysql_select_db($database_domains_conn, $domains_conn);
$Result1 = mysql_query($UpdateSQL, $domains_conn) or die(mysql_error());	

if($fulldesc[1] == "") {

echo $row_getdomains['domains_domain']." is avaialble!";

}else{

echo "Domain: ".$row_getdomains['domains_domain']." Registrar was: ".$row_getdomains['domains_a']."  Registrar is now: ".$ipstag;		
}
			
}

} while ($row_getdomains = mysql_fetch_assoc($getdomains));		

// echo $domainsTypeOther;

?>
<?php
mysql_free_result($getdomains);
?>

You'd need to change the $desc = preg_match("[Tag = (.*)]", $file, $fulldesc); to look for the date.

Awesome tool for regular expressions lives at http://gskinner.com/RegExr/

Lee
 
Last edited:
Don't try blagging your IP either, albeit nom are kinda slow at detecting it, they do spot the patterns ;)
 
is there a place that i can find out where i can find out how many queries i have left for any given time?
 
counter

Im not sure if there is an official area within Nominet to monitor this but you could apply a counter to any of your PHP script to keep an eye on how many times you query it.

Lee
 
If you go over the limit you get an display that says you have used your quota. If it happens alot you get blocked. I have been blocked before now, they blacklisted my whole ISP for about 3 months, so I had to use a proxy all the time.
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

No members online now.

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom