I've got a huge form which I want to echo out the values of when there's a problem. I'm using
for example.
But if the form's not submitted, how do I stop it showing the notice of the variable not having a value?
I need to somehow do something like this, but I have no idea how to get around it easily
PHP:
<input type="text" name="email" value="<?php echo $backend->email ?>
But if the form's not submitted, how do I stop it showing the notice of the variable not having a value?
PHP:
function cleanup(){
if(isset($_GET)){
foreach($_GET as $key=>$value){
strip_tags($_GET[$key]);
mysql_real_escape_string($_GET[$key]);
$this->$key = $value;
}
}
if(isset($_POST)){
foreach($_POST as $key=>$value){
strip_tags($_POST[$key]);
mysql_real_escape_string($_POST[$key]);
$this->$key = $value;
}
}
}
PHP:
if(form not submitted){
give 'this->fieldname' a value of ''
}