• Login
  • Register
  • Zoek
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Filebase Entry
  • More Options

ICTscripters

Dé plek voor IT

Dé plek voor IT

Login

Geavanceerde opties
  1. Home
  2. Forum
    1. Alle berichten
    2. Recente activiteiten
  3. ICT Nieuws
  4. Blog
  5. Marktplaats
    1. Werk
    2. Advertenties
    3. Domeinnamen
    4. Websites
    5. Design & lay-outs
    6. Scripts
    7. Overige
  6. Design
  7. Leden
    1. Actieve bezoekers
    2. Team
    3. Leden zoeken
  8. Downloads
  9. Goedkope domeinnamen
  1. Home
  2. Forum
    1. Alle berichten
    2. Recente activiteiten
  3. ICT Nieuws
  4. Blog
  5. Marktplaats
    1. Werk
    2. Advertenties
    3. Domeinnamen
    4. Websites
    5. Design & lay-outs
    6. Scripts
    7. Overige
  6. Design
  7. Leden
    1. Actieve bezoekers
    2. Team
    3. Leden zoeken
  8. Downloads
  9. Goedkope domeinnamen
  1. Home
  2. Forum
    1. Alle berichten
    2. Recente activiteiten
  3. ICT Nieuws
  4. Blog
  5. Marktplaats
    1. Werk
    2. Advertenties
    3. Domeinnamen
    4. Websites
    5. Design & lay-outs
    6. Scripts
    7. Overige
  6. Design
  7. Leden
    1. Actieve bezoekers
    2. Team
    3. Leden zoeken
  8. Downloads
  9. Goedkope domeinnamen
  1. Dé plek voor IT - ICTscripters
  2. Forum
  3. Scripting & programmeren
  4. PHP + SQL

Forum

  • Fallen Kingdom Game

    gozmeu 27 juli 2026 om 23:49
  • Crimora.nl

    Dennii 11 juli 2026 om 13:13
  • RPG game gebouwd met AI

    zwpgangster 9 juli 2026 om 11:25
  • (Verkoop) Criminals

    Syntax 5 juli 2026 om 13:22
  • Het Grote Vibe Code Topic

    Syntax 30 juni 2026 om 11:54
  • Ictscripters Chat

    Jeffrey.Hoekman 26 juni 2026 om 16:21
  • Het oorspronkelijke Criminals Script

    Jeroen.G 24 juni 2026 om 09:21
  • StraatBaas is back, maar hoe?!

    Syntax 17 juni 2026 om 10:28

Marktplaats

  • Straatbaas.eu – complete Nederlandstalige en Engelstalige online maffia-RPG

    Syntax 28 juli 2026 om 15:47
  • 306 Nieuwe Domeinnamen Juni 2026

    shiga 1 juli 2026 om 13:39
  • 4-letter domein: Togi.nl

    evesi 17 juni 2026 om 17:08

mail + Attachment

  • glammiiee
  • 7 juni 2012 om 14:56
  • glammiiee
    Praat Community
    Berichten
    526
    • 7 juni 2012 om 14:56
    • #1

    Beste mensen,

    Naveel stoeien lukt het me niet.
    De bedoeling is dat er een attachment gesturd wordt met een stuk tekst in de mail zelf.

    Alleen de Attachment krijg ik netjes mee, alleen de tekst wat erbij moet komen niet.

    Ik hoop dat iemand het probleem ziet.

    PHP
    <div class="subtitle">
            	<img src="./images/thumbs/icon_newspaper.png" alt="icon" title="icon" class="icon" />
                <h3>Solicitatie Formulier</h3>
            </div>
            
            <div class="maintxt">
                <div id="maintekst">
       				<div id="tekst" style="display: block;">
    <?php
    session_start(); 
    
    
    $mail_ontv = '****@live.nl';
    
    
    
    
    if ($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        // naam controle
        if (!preg_match('/[ a-zA-Z-]$/', $_POST['naam']))
            $naam_fout = 1;
        // e-mail controle
        if (function_exists('filter_var') && !filter_var($_POST['mail'], FILTER_VALIDATE_EMAIL))
                $email_fout = 1;
        // antiflood controle
        if (!empty($_SESSION['antiflood']))
        {
            $seconde = 60; 
            $tijd = time() - $_SESSION['antiflood'];
            if($tijd < $seconde)
                $antiflood = 1;
        }
    }
    
    
    if (($_SERVER['REQUEST_METHOD'] == 'POST' && (!empty($antiflood) || empty($_POST['naam']) || !empty($naam_fout) || empty($_POST['mail']) || !empty($email_fout) || empty($_POST['bericht']) || empty($_POST['telefoonnummer']) || empty($_POST['onderwerp']))) || $_SERVER['REQUEST_METHOD'] == 'GET')
    {
        if ($_SERVER['REQUEST_METHOD'] == 'POST')
        {
            if (!empty($naam_fout))
                echo '<p>Uw naam mag alleen letters bevatten.</p>';
            elseif (!empty($email_fout))
                echo '<p>Uw e-mailadres is niet juist.</p>';
            elseif (!empty($antiflood))
                echo '<p>U mag slechts &eacute;&eacute;n bericht per ' . $seconde . ' seconde versturen.</p>';
            else
                echo '<p>U bent uw naam, e-mailadres, onderwerp, Motivatie of CV vergeten in te vullen.</p>';
        }
            
    
    
      echo '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '" enctype="multipart/form-data" />
      <table width="630">
    	<tr>
    		<td width="25%"><label for="naam">naam:</label></td>
    		<td width="75%"><input type="text" id="naam" name="naam" value="' . (isset($_POST['naam']) ? htmlspecialchars($_POST['naam']) : '') . '" /></td>
    	</tr>
    	<tr>
    		<td><label for="mail">E-mailadres:</label>
    		<td><input type="text" id="mail" name="mail" value="' . (isset($_POST['mail']) ? htmlspecialchars($_POST['mail']) : '') . '" /></td>
    	</tr>
    	<tr>
    		<td><label for="telefoonnummer">Telefoon nummer:</label></td>
    		<td><input type="text" id="telefoonnummer" name="telefoonnummer" value="' . (isset($_POST['telefoonnummer']) ? htmlspecialchars($_POST['telefoonnummer']) : '') . '" /></td>
    	</tr>
    	<tr>
    		<td><label for="onderwerp">Onderwerp:</label></td>
    		<td><input type="text" id="onderwerp" name="onderwerp" value="' . (isset($_POST['onderwerp']) ? htmlspecialchars($_POST['onderwerp']) : '') . '" /></td>
    	</tr>
    	<tr>
    		<td><label for="bericht">Motivatie:</label></td>
    		<td><textarea id="bericht" name="bericht" rows="8" style="width: 400px;">' . (isset($_POST['bericht']) ? htmlspecialchars($_POST['bericht']) : '') . '</textarea></td>
    	</tr>
    	<tr>
    		<td><label for="cv">Curriculum Vitae</label></td>
    		<td><input type="file" name="fileAttach">
    	<tr>
    		<td>&nbsp;</td>
    		<td><input type="submit" name="submit" value=" Versturen " /></td>
    	</tr>
    </table>
      
      </form>';
    }
    
    
    else
    {      
    
    
      $datum = date('d/m/Y H:i:s');
        
      $inhoud_mail = "===================================================\n";
      $inhoud_mail .= "Ingevulde contact formulier " . $_SERVER['HTTP_HOST'] . "\n";
      $inhoud_mail .= "===================================================\n\n";
      
      $inhoud_mail .= "Naam: " . htmlspecialchars($_POST['naam']) . "\n";
      $inhoud_mail .= "E-mail adres: " . htmlspecialchars($_POST['mail']) . "\n";
      $inhoud_mail .= "Telefoon nummer: " . htmlspecialchars($_POST['telefoonnummer']) . "\n";
      $inhoud_mail .= "Motivatie:\n";
      $inhoud_mail .= htmlspecialchars($_POST['bericht']) . "\n\n";
        
      $inhoud_mail .= "Verstuurd op " . $datum . " via het IP adres " . $_SERVER['REMOTE_ADDR'] . "\n\n";
        
      $inhoud_mail .= "===================================================\n\n";
    
    
    $uid = md5(uniqid(time()));
    
    
      $headers = 'From: ' . htmlspecialchars($_POST['naam']) . ' <' . $_POST['mail'] . '>';
    
    
    
    
      //*** Attachment ***//  
    if($_FILES["fileAttach"]["name"] != "")  
    {  
    $strFilesName = $_FILES["fileAttach"]["name"];  
    $strContent = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"])));  
    $headers .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n";  
    $headers .= "Content-Transfer-Encoding: base64\n";  
    $headers .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n";  
    $headers .= $strContent."\n\n";  
    
    
    } 
      
      $_POST['onderwerp'] = str_replace('\n', '', $_POST['onderwerp']); // Verwijder \n
      $_POST['onderwerp'] = str_replace('\r', '', $_POST['onderwerp']); // Verwijder \r
      $_POST['onderwerp'] = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $_POST['onderwerp'])); // Slashes van quotes
      
      if (mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers))
      {
    
    
          $_SESSION['antiflood'] = time();
          
          echo '
          <p>Bedankt voor het invullen van het contactformulier. We zullen zo spoedig mogelijk contact met u opnemen.</p>';
      }
      else
      {
          echo '
          <p><b>Onze excuses.</b> Het contactformulier kon niet verzonden worden.</p>';
      }
    }
    ?> 
    				</div>
               </div>
    Toon Meer

Participate now!

Heb je nog geen account? Registreer je nu en word deel van onze community!

Maak een account aan Login

ICT Nieuws

  • Quanscient ontvangt €10M om AI- en kwantum-native hardware engineering te bevorderen - Tech.eu

    ICTscripters 27 mei 2026 om 12:03
  • Datalek bij leverancier Canvas - Universiteit van Amsterdam

    ICTscripters 10 mei 2026 om 12:03
  • Data privacy in 2026: Hoe de naleving van GDPR verandert

    ICTscripters 8 mei 2026 om 12:16

Blogs

  • Functioneel ontwerp

    Dees 28 december 2014 om 12:38
  • Access Control List implementatie in PHP/MySQL - deel 1/2

    FangorN 28 december 2018 om 12:35
  • Access Control List implementatie in PHP/MySQL - deel 2/2

    FangorN 29 december 2018 om 12:37
  1. Marktplaats
  2. Design
  3. Voorwaarden
  4. Ons team
  5. Leden
  6. Geschiedenis
  7. Regels
  8. Links
  9. Privacy Policy
ICTscripters ©2005 - 2026 , goedkope hosting door DiMoWeb.com, BE0558.915.582
Sponsors: Beste kattenhotel provincie Antwerpen | Beste Zetes eid kaartlezer webshop
Style: Nexus by cls-design
Stylename
Nexus
Manufacturer
cls-design
Licence
Commercial styles
Help
Supportforum
Visit cls-design