Here is the way I am doing it currently:
Code: Select all
<?php echo (isset($form)) ? $form['email'] : ''; ?>Moderator: General Moderators
Code: Select all
<?php echo (isset($form)) ? $form['email'] : ''; ?>Code: Select all
foreach ($_POST as $name => $value) {
$form[$name] = (!empty($value) ? $value : '');
}Code: Select all
$valid = array(
'name',
'email',
'birth'
);
foreach ($_POST as $name => $value) {
if (in_array($name,$valid)) {
$form[$name] = (!empty($value) ? $value : '');
}
}Code: Select all
function ($method, $valid) {
$form = array();
foreach ($method as $name => $value) {
if (in_array($name,$valid)) {
$form[$name] = (!empty($value) ? $value : '');
}
}
return $form;
}Not sure what you mean wouldn't help much also thinking about it I can't send it to a function to check because if the variable doesn't exsist then it will generate a error instead.shiznatix wrote:much less complicated: change isset to !empty
Code: Select all
<?php echo (!empty($form)) ? $form['email'] : ''; ?>Code: Select all
<?php echo @$form['email']; ?>