what is the shorted if else block for this. I seen it somewhere before but cant remember it.
if (isset($_POST['value')){
$value = $_POST['value'];
} elseif (isset($_GET['value'])){
$value = $_GET['value'];
} else {
$value = '';
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you referring to using the $_REQUEST global array instead of checking both $_POST and $_GET? If so, it should be:
Or the ternary form: