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('timiejboi@gmail.com', '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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.