12-22-2007, 02:13 PM
|
#3 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 264
Thanks: 2
|
PHP Code:
if ($_SERVER['REQUEST_METHOD'] == 'GET'){
$domain = $_GET['domain'];
$ext = $_GET['ext'];
$option = $_GET['option'];
}else{
$domain = (eregi('$^[A-Z0-9._%+=]+\.[A-Z]{2,6}$',$_POST['domain'])) ? $_POST['domain'] : 'google.com';
$ext = $_POST['ext'];
$option = ($_POST['option'] == 'check') ? $_POST['option'] : 'whois';
}
if($restrict ==1){
check_referer();
}
Well since theres no mysql interaction, no uploads and the such, all we can do is insure that the domain is actually a domain and that the option is either of the two available options.
the former I accomplished by using the eregi() function inside a tertionary (hope I spelled it right) which is essential a very streamlined if/else statement here is an example
PHP Code:
$echo = (5 > 3) ? 'true' : 'false';
echo $echo;
the latter was done again with a tertionary and it checked
PHP Code:
$_POST['domain']
to see if it's 'check' if it is, then we leave the $_POST variable alone, if it's not then it's set to whois
|
|
|
|