I get a T_IF errore something wrong with the if but I don't understand why. Here is a part of the code,where I think the error ocure. $fields = array(); $fields{"email"} = "email"; $fields{"serial"} = "serial"; $fields{"schedamadre"} = "schedamadre"; $fields{"processore"} = "processore"; $fields{"schedaaudio"} = "schedaaudio"; $fields{"schedarete"} = "schedarete"; $fields{"cddvd"} = "cddvd"; $fields{"descrizione"} = "descrizione"; $fields{"errore"} = "errore"; $fields{"programmi"} = "programmi"; $fields{"nome"} = "nome"; $fields{"cognome"} = "cognome"; $fields{"indirizzo"} = "indirizzo"; $fields{"citta"} = "citta"; $fields{"provincia"} = "provincia"; $fields{"telefono"} = "telefono"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $time = date('l dS \of F Y h:i:s A'); $email_subject = "New contact message from ".$site_name.""; $sender=mail($admin_email,$email_subject,$body,"From:$check_email,Reply-to:$check_email") if($sender) { header("Location: index.php?status=1"); } else { header("Location: index.php?status=0"); } Code (markup):
1. You missed a semicolon before if. 2. It was a surprise for me you use curve brackets {} for accessing array members and it works! I always use square ones [] for that.
I hate when you're looking through your code and you just can't figure it out, because its a = or == error. but an missing semicolon should atleast tell you the line which makes it easier.