|
Hello, I need some help with PHP and Redirectal stuff. What I am doing is implementing a a script on my site that simply checks the availability of domain names. However, if a domain name IS available, I would like the customer to be redirected to "Page A." If the domain name is NOT available, I would like the customer to be redirected to "Page B." Below is the script that I need to edited. Thanks and I would greatly appreciate any help I can get.
Matt
<?
include ("tld_check_form.php");
function whois ($a_server, $a_query, $a_port=43)
{
$available = "No match";
$available2 = "Not found";
$a_query = str_replace("www.", "", $a_query);
$a_query = str_replace("http://", "", $a_query);
global $whois_servers;
@reset($whois_servers);
$a_query = $a_query . "." .
$a_server;
$a_server = $whois_servers[$a_server];
$sock = @fsockopen($a_server,$a_port);
IF (!$sock) {
echo ("<b>Could Not Connect To Server.</b>");
}
ELSE {
$send_request = @fputs($sock,"$a_query\r\n");
IF (!$send_request) {
echo ("<B>Unable to send request.</B>");
}
ELSE
{
while(!feof($sock)) {
$result .= fgets($sock,128);
}
$result = str_replace("\n", "<br>", $result);
IF (@eregi($available,$result) OR @eregi($available2,$result)) {
echo ("<BR><BR>
<font color=\"blue\"><b>$a_query is available.</b></font>");
}
ELSE {
echo ("<BR><BR>
<font color=\"red\"><b>$a_query is not available.</b></font>
<BR>
");
}
@fclose($sock);
}
}
}
// Check request, post form
IF (!empty($_REQUEST[query]))
{
whois($_REQUEST[server],$_REQUEST[query]);
}
ELSE IF (isset($_REQUEST[query]))
{
echo ("<b>Domain name left blank. Please fill in a domain name and try again.</b>");
}
?>
|