Jump to content

mailform


timmiejboi

Recommended Posts

the sript tells me he send it, without i fill in anything.

and i dont get any mail


testversion : remcogaasenbeek.nl/nieuw
index.html

<form name="form1" method="post" action="verzenden.php">
  <table width="400" border="0">
    <tr>
      <td colspan="2">
       
        </b></td>
    </tr>
    <tr>
      <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Naam</font></td>
      <td width="70%">
        <input type="text" name="naam" size="20">
      </td>
    </tr>
    <tr>
      <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Email</font></td>
      <td width="70%">
        <input type="text" name="email" size="20">
      </td>
    </tr>
     <tr>
      <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Telefoonnummer</font></td>
      <td width="70%">
        <input type="text" name="telefoonnummer" size="20">
      </td>
    </tr>
 <tr>
      <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Woonplaats</font></td>
      <td width="70%">
        <input type="text" name="woonplaats" size="20">
      </td>
    </tr>
    </tr>
    <tr>
      <td colspan="2">
        <font face="Arial" size="2"><br>
        <input type="submit" name="submit" value="Verstuur">
        </font>
        </td>
    </tr>
  </table>
</form>
<font color="#f19028">*</font> <font size="1"> De proefles is gratis indien men besluit om een rijopleiding <BR>bij rijschool Remco Gaaseneek te nemen. anders blijft het een vrijblijvende les van €25,-.</font>

<?php
if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['telefoonnummer'])) {
    echo 'U heeft niet alle velden ingevuld!';
    exit;
}
 
$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$telefoonnummer = htmlspecialchars($_POST['telefoonnummer']);
$woonplaats= htmlspecialchars($_POST['woonplaats']);
 
$tijd = time();
$datum = strftime('%d/%m/%y %H:%M', $tijd);
$ip = getenv('REMOTE_ADDR');
$message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende nummer en woonplaats:
____________________________________
'.$telefoonnummer.' 
'.$woonplaats.'
------------------------------------';
 
mail('[email protected]', 'proefles', $message, 'From: '.$email);                                 
echo 'Uw bericht is verzonden. U krijgt zo snel mogelijk antwoord.';
?>

i hope u guys can help me out.

 

cheers,

timmiejboi

 

Link to comment
https://forums.phpfreaks.com/topic/290484-mailform/
Share on other sites

text textarea, and password form fields will be set, even if they are empty.

 

your form processing logic should first test if your form was submitted, then specifically test the content from each form field. for fields that are required, at a minimum, you would want to test if their character length is greater than an acceptable minimum.

Link to comment
https://forums.phpfreaks.com/topic/290484-mailform/#findComment-1488044
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.