Page 1 of 1

PHP URGENT HELP

Posted: Thu Jul 22, 2010 3:59 pm
by netbie
I have the following php code that take 2 variables for redirect to a subdomain, it works ok


<?php

$p = $_GET['p'];
$a = $_GET['a'];

$review_url = 'http://' . $a . '.' . $p . '.com';
header('Location: ' . $review_url);

exit();


?>


But my problem is that when the variables come null or by error there is not variables values in the string then it redirect to "..com"

What can I do to show any warning text if the variable values come null ,insteance of the redirecting ????

Thanks in advance

Re: PHP URGENT HELP

Posted: Thu Jul 22, 2010 4:11 pm
by AbraCadaver
if ! empty()

And you probably need a lot more sanitization than that.

Re: PHP URGENT HELP

Posted: Thu Jul 22, 2010 4:30 pm
by netbie
Thanks a lot, problem solved