Nieuw lid | 
                 | 
                
				
				Hey allen, 
Ik heb een contactformulier dat eruit ziet als volgt: 
    
    
        
            
                <script language="JavaScript" type="text/JavaScript">
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
</script>
<FORM NAME="form1" METHOD="post" ACTION="contact.php">
<input type="hidden" name="action" value="send">
<INPUT TYPE=TEXT NAME="name" VALUE=" name" onFocus="clearDefault(this)" style="border-top:0px; border-left:0px; border-right:0px; border-bottom: 1px dotted #cc6600; width:150px">
<br> <br>
<INPUT TYPE=TEXT NAME="email" VALUE=" email adress" onFocus="clearDefault(this)" style="border-top:0px; border-left:0px; border-right:0px; border-bottom: 1px dotted purple; width:150px;">
<br> <br>
<TEXTAREA NAME="message" style="border-top:0px; border-left:1px dotted #0066cc; border-right:0px; border-bottom: 1px dotted #0066cc; width:150px; height:63px"> message</TEXTAREA>
<br> <br>
<INPUT TYPE="image" SRC="images/sendarrow.gif" VALUE="send">
<img src="images/clear.gif" onclick="document.getElementById('form1').reset();" style="cursor:pointer"/>
</FORM>
             
            <script language="JavaScript" type="text/JavaScript"> function clearDefault(el) { if (el.defaultValue==el.value) el.value = "" } <FORM NAME="form1" METHOD="post" ACTION="contact.php"> <input type="hidden" name="action" value="send"> <INPUT TYPE=TEXT NAME="name" VALUE=" name" onFocus="clearDefault(this)" style="border-top:0px; border-left:0px; border-right:0px; border-bottom: 1px dotted #cc6600; width:150px"> <INPUT TYPE=TEXT NAME="email" VALUE=" email adress" onFocus="clearDefault(this)" style="border-top:0px; border-left:0px; border-right:0px; border-bottom: 1px dotted purple; width:150px;"> <TEXTAREA NAME="message" style="border-top:0px; border-left:1px dotted #0066cc; border-right:0px; border-bottom: 1px dotted #0066cc; width:150px; height:63px"> message </TEXTAREA> <INPUT TYPE="image" SRC="images/sendarrow.gif" VALUE="send"> <img src="images/clear.gif" onclick="document.getElementById('form1').reset();" style="cursor:pointer"/> 
 
  
         
          
     
  
 
en  
 
    
    
        
            
                <?php
if ($_POST["action"] == "send"){
if ($_POST[name] != " name" and $_POST[name] != "" and $_POST[email] != " e-mail adress" and $_POST[email] != "" and $_POST[message] != "") { 
mail ("info@site.com", "via site", 
"
Name: ".$_POST['name']."
E-mail: ".$_POST['email']."
Message: ".$_POST['message']."
",
"From: ".$_POST['name']." <".$_POST['email'].">");
$subject = "your message to xx"; 
$msg = "
This is an automatically sent email. Please do not reply.
Dear $_POST[name],
Thanks for your message to xx.
She will get back to you as soon as possible.
This was your message:
$_POST[message] 
";  
mail($_POST[email], $subject, $msg); 
echo 'Thanks ! Your message has been sent, and you will receive a confirmation mail. <br><br> We will get back to you as soon as we can.<br> <br><br>';
}
else{
echo '<font color="#FF0000">Please fill in all data!</font><br><br>Your name, email adress and message are mandatory fields.<br><br><a href="contact.html"><font color="#FF0000">[again please]</font></a><br> <br>';
}
}
?>
             
            <?php   if ($_POST["action"] == "send"){   if ($_POST[name] != " name" and $_POST[name] != "" and $_POST[email] != " e-mail adress" and $_POST[email] != "" and $_POST[message] != "") {  mail ("info@site.com", "via site",  " Name: ".$_POST['name']." E-mail: ".$_POST['email']." Message: ".$_POST['message']."   ", "From: ".$_POST['name']." <".$_POST['email'].">");   $subject = "your message to xx";    $msg = "   This is an automatically sent email. Please do not reply.   Dear $_POST[name],   Thanks for your message to xx. She will get back to you as soon as possible.   This was your message: $_POST[message]  ";     mail($_POST[email ], $subject, $msg);    echo 'Thanks ! Your message has been sent, and you will receive a confirmation mail. <br><br> We will get back to you as soon as we can.<br> <br><br>';   }   else{ echo '<font color="#FF0000">Please fill in all data!</font><br><br>Your name, email adress and message are mandatory fields.<br><br><a href="contact.html"><font color="#FF0000">[again please]</font></a><br> <br>'; } } ?> 
 
  
         
          
     
  
 
Het formulier mag niet verzonde worden als één van volgende gebeurt: 
1. Name equals " your name" 
2. Name is blank 
3. Email equals " your e-mail address" 
4. Email is blank 
3. Message equals " your message" 
5. Message is blank 
 
Wat is er mis met de code ?				
				 |