0

I was working on this contact form, it was working but now not anymore. I have no idea what i did wrong or did i mess something up? I really hope someone will be able to help, or some tips what would work better? Already thank you!

     <?php
    $submit=$_POST['Submit'];
    if($submit == Submit){
    $status = "OK";
    $email=$_POST['email'];
    $message=$_POST['message'];
    $subject=$_POST['subject'];
    $titel=$_POST['titel'];
    $naam=$_POST['naam'];
    $bedrijfsnaam=$_POST['bedrijfsnaam'];
    $phone=$_POST['phone'];

    $msg="";
    $msgerror="";
    //error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);


if ( strlen($naam) < 1 ){
    $msgerror=$msgerror."* No name.<BR />";
    $status= "NOTOK";}  

if ( strlen($message) < 3 ){
    $msgerror=$msgerror."* No message.<BR/>";
    $status= "NOTOK";}  

if (!stristr($email,"@") OR !stristr($email,".")) {
    $msgerror=$msgerror."* No email<BR />";
    $status= "NOTOK";}   

if ( strlen($phone) < 6 ){
    $msgerror=$msgerror."* No phone.<BR />";
    $status= "NOTOK";}  


if($status=="OK"){// echo $query;
    $headers="";
    $headers4="info@abc.com"; // Fake address //
    $headers.="Reply-to: $headers4\n";
    $headers .= "From: $headers4\n";
    $headers .= "Errors-to: $headers4\n";
    $headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers;
mail($headers4,$subject,"Contact <BR>

Titel:$titel
<BR>Naam:$naam
<BR>Bedrijfsnaam:$bedrijfsnaam
<BR>Email:$email
<br>Telefoonnummer:$phone
<br>Comments: $message","$headers");
$msg="Thank you!.";
}
    }
?>



<div id="form">
                <?php if($msg) { ?><div class="success"><p><? echo $msg; ?></p></div><? } ?>
                <?php if($msgerror) { ?><div class="error"><?php echo $msgerror; ?></div><?php } ?>

                        <form action="contact.php" method="post" name="form1" id="form1">

                            <label>Titel:</label>
                            <input type="radio" name="titel" value="Dhr."  class="rad"    /> Dhr.      
                            <input type="radio" name="titel" value="Mevr."  class="rad"  /> Mevr.    <br />

                            <label>Naam: *</label>
                            <input type="text" name="naam" class="input" />          <br />

                            <label>Bedrijfsnaam:</label>
                            <input type="text" name="bedrijfsnaam" class="input" />          <br />

                            <label>Mijn bericht betreft een:</label>
                            <select name="subject">
                            <option>Maak uw keuze</option>
                                <option value="Offerte">Offerte</option>
                                <option value="Vraag">Vraag</option>
                                <option value="Opmerking">Opmerking</option>
                            </select>   <br />

                            <label>Bericht: *</label>
                            <textarea name="message" rows="" cols=""></textarea>    <br />

                            <label>E-mailadres: *</label>
                            <input type="text" name="email" class="input" />        <br />

                            <label>Telefoonnummer: *</label>
                            <input type="text" name="phone" class="input" />        <br />

                        <div class="indent"> 
                            <input type="hidden" name="Submit" value="Submit" />
                            <input name="submit" class="" type="image" src="images/submit_button.gif" value="Send Message"/>
                        </div>
                    </form>

                </div>  

//// Like this? ///

if($status=="OK"){// echo $query;
    $headers="";
    $headers.="info@abc.com"; // Fake address //
    $headers.="Reply-to: $headers4\n";
    $headers.= "From: $headers4\n";
    $headers.= "Errors-to: $headers4\n";
    $headers.= "Content-Type: text/html; charset=iso-8859-1\n".$headers;
mail($headers.,$subject,"Contact <BR> 
4

0 回答 0