March 5, 201016 yr $salutation = $_POST['salut']; $fname = $_POST['fromname']; $fmail = $_POST['frommail']; $subject = $_POST['mailsubject']; $message = $_POST['mailtext']; echo($fname); if (empty($fname) == true) { $fname_style = "marked"; header("location:contactform.php"); echo ('is leer'); exit(); } why does this not send me back to contactform.php ???
March 5, 201016 yr It's not allowed to display anything before the header command. therefore you need to remove echo($fname); $salutation = $_POST['salut']; $fname = $_POST['fromname']; $fmail = $_POST['frommail']; $subject = $_POST['mailsubject']; $message = $_POST['mailtext']; echo($fname); if (empty($fname) == true) { $fname_style = "marked"; header("location:contactform.php"); echo ('is leer'); exit(); } why does this not send me back to contactform.php ???
March 5, 201016 yr Author thx I got it =) but there is another problem ... if (empty($fname) == true) { global $fname_style; $fname_style = "marked"; header("location:contactform.php"); exit(); } the css says .marked {border : solid 3px #AB0000;} and the php-form ... <td width=100%><input type="text" name="fromname" size=50 maxlength=120 value="" class="<?php echo ($fname_style); ?>"></td> if this is empty the color of the border should change ... but it does not ??? Where is my mistake ??? I think with class="<?php echo ($fname_style); ?> but I am not sure ...
Create an account or sign in to comment