Whois PHP script
I would like to know how can I add a button to enable user to register the available domain name? My idea is to a button linked to registration page next to the available domain name. When the user click the button, the name of the searched domain will be passed to the next page, which is the registration page.
I've added the following code, but it's not working.
function showDomainResult($domain,$server,$findText){
if ($this->tr == 0){
$this->tr = 1;
$class = " class='tr2'";
} else {
$this->tr = 0;
$class = "";
}
if ($this->checkDomain($domain,$server,$findText)){
echo "<tr $class><td>$domain</td><td>$this->daftar_tld($domain)</td></tr>";
}
else echo "<tr $class><td>$domain</td><td class='tak'>TAKEN</td></tr>";
}
// To display register button
function daftar_tld($domain){
?>
<form method=post action="http://www.com">
<center><input value=$_POST["$domain"]><input type="submit" name="butangDaftar" class="sbtn" value="Register" /></center>
</form>
<?php
}
?>
And the output that I get is this (image is provided at the link below):
http://lh5.ggpht.com/_d7N0eqyUoUw/TGgPvCt4B3I/AAAAAAAAAHY/T7e4KjVNT04/Screen%20shot%202010-08-14%20at%2012.53.59%20PM.png
I really hope that someone can help me. I've been working on this for day开发者_C百科s. Phewwww...
You haven't set a name or type for the input variable holding the domain:
Your code:
<center><input value=$_POST["$domain"]><input type="submit" name="butangDaftar" class="sbtn" value="Register" /></center>
Suggested code:
<center><input type="hidden" name="domainToRegister" value="<?php echo $_POST["$domain"]; ?>" /><input type="submit" name="butangDaftar" class="sbtn" value="Register" /></center>
The form will then submit the domain as $_POST['domainToRegister'].
精彩评论