Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

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:
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.

Rule #1: Be Respectful

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

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom