missing tags or quotes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
faza
Forum Newbie
Posts: 9
Joined: Tue Jun 22, 2010 4:28 pm

missing tags or quotes

Post by faza »

my code was working perfectly earlier now i ve changed the table a bit and for some reason it wont work i cant figure out whats wromg

Code: Select all

<html><h1 style="text-align:center;">Whois lookup Results</h1></center>
<br>
<body>
<center>
<?php 
	$domain_string = $_POST["Domainname"]; 
	$domain_array = explode("\n", $domain_string);
	foreach ($domain_array as $domain) {	
	$domain = trim($domain);
	if ($domain != "") {
	$result = shell_exec('whois ' . $domain);
$srcharray = array(
                "no match",
                "not found",
                "no found",
                "nothing found",
                "no domain",
                "no data found",
                "no data was found",
                "no entries found",
                "status: free",
                "status: available",
                "is free",
                "does not exist",
                "no information",
                "we do not have",
                "not registered",
                "nomatch",
                "no such domain",
                "no live registration",
                "not in whois database",
                "not yet been delegated",
                "not yet been registered",
                "not delegated",
                "no records matching",
                "no records found",
                "- available",
                "220 available",
                "no existe",
                "domain status: avail",
                "dominio no registrado",
                "has not yet been registered",
                "has not yet been delegated",
                "nije registrirana",
                "domain name not known",
                "not in the uanic",
                "not a domain controlled by",
                "object_not_found",
                );
$term_list = implode("|", $srcharray);
		echo'
		<center>	
			<table border="2" >
				<tr>
					<td width="800" height="100">
						<center>;
						if (preg_match("/$term_list/i" , $result)) {
						echo '<h2 style="color:green;"><blink>AVAILABLE!</blink></h2>';
						} else 
						{
						echo '<h2 style="color:red;"><blink>UNAVAILABLE!</blink></h2>';
						}
						</center>
					</td>
				</tr>
				<tr>
					<td width="800" height="100">
						<center><h3>Whois '.$domain.'</h3></center>
					</td>
				</tr>		
				<tr>
					<td width="800" height="600">
						<center>
						str_replace("\n", "<br>", $result) .
						</center>
					</td>
				</tr>
			</table>
		</center>;
		'
		}
	}
	
?>
</body>
</html>
Last edited by Weirdan on Mon Jul 05, 2010 1:35 pm, edited 1 time in total.
Reason: added [syntax] tags
User avatar
rolanddev
Forum Newbie
Posts: 9
Joined: Mon Jul 05, 2010 12:28 pm
Location: Bucharest

Re: missing tags or quotes

Post by rolanddev »

Code: Select all


<html><h1 style="text-align:center;">Whois lookup Results</h1></center>
<br>
<body>
<center>
<?php

$domain_string = "http://google.com";
//$domain_string = $_POST["Domainname"];
$domain_array = explode("\n", $domain_string);
foreach ($domain_array as $domain) {
$domain = trim($domain);
if ($domain != "") {
$result = shell_exec("whois $domain");
echo $result[1];
$srcharray = array(
"no match",
"not found",
"no found",
"nothing found",
"no domain",
"no data found",
"no data was found",
"no entries found",
"status: free",
"status: available",
"is free",
"does not exist",
"no information",
"we do not have",
"not registered",
"nomatch",
"no such domain",
"no live registration",
"not in whois database",
"not yet been delegated",
"not yet been registered",
"not delegated",
"no records matching",
"no records found",
"- available",
"220 available",
"no existe",
"domain status: avail",
"dominio no registrado",
"has not yet been registered",
"has not yet been delegated",
"nije registrirana",
"domain name not known",
"not in the uanic",
"not a domain controlled by",
"object_not_found",
);
$term_list = implode("|", $srcharray);
echo"
<center>
<table border='2' >
<tr>
<td width='800' height='100'>
<center>";
if (preg_match("/$term_list/i" , $result)) {
echo "<h2 style='color:green;'><blink>AVAILABLE!</blink></h2>";
} else
{
echo "<h2 style='color:red;'><blink>UNAVAILABLE!</blink></h2>";
}
?>
</center>
</td>
</tr>
<tr>
<td width="800" height="100">
<center><h3>Whois <?php echo $domain; ?></h3></center>
</td>
</tr>
<tr>
<td width="800" height="600">
<center>
<?php
str_replace("\n", "<br>", $result);
?>
</center>
</td>
</tr>
</table>
</center>
<?php
}
}
?>
</body>
</html>
I repaired it for you, I think you replaced " with ' or " with '.
Now it works, you have to optimize the shell_exec("whois $domain") function and it will work correctly, I hope I was helpful!
Post Reply