Contact Formulier

Gestart doorAllard4 reacties31 weergaven

5 berichten · pagina 1 van 1

Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beste,

Ik zoek een contact script met het volgende. Maar kan het ook gecontroleerd worden? De invoer bedoel ik.
  • Aanhef
  • Voornaam
  • Achternaam
  • Email
  • Onderwerp
  • Bericht
0
Berichten
515
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]send[/COLOR][COLOR= #007700]])) {[/COLOR]

        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]subject[/COLOR][COLOR= #007700]] || ![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]] || ![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]] || ![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]message[/COLOR][COLOR= #007700]] || ![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]acternaam[/COLOR][COLOR= #007700]] || ![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aanhef[/COLOR][COLOR= #007700]]){[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]u moet wel wat invullen[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]/^[^@]+@[a-zA-Z0-9._-]+.[a-zA-Z]+$/[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Geen geldig email adres![/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$to[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]  [COLOR= #FF8000]//Jou email[/COLOR]
        [COLOR= #0000BB]$subject[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]subject[/COLOR][COLOR= #007700]];[/COLOR]
        
        [COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]U heeft bericht van:<br />
        [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aanhef[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] .[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]achternaam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]<br />
        Het bericht betreft het volgende: [/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$message[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]message[/COLOR][COLOR= #007700]];[/COLOR]
        
        [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]MIME-Version: 1.0[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Content-type: text/html; charset=iso-8859-1[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Reply-To:  [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000][/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]X-Mailer: PHP/[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/phpversion"]phpversion[/URL][COLOR= #007700]();[/COLOR]
        
        [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$to[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$subject[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$message[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Mail is succesvol verzonden.[/COLOR][COLOR= #007700];
    }
}[/COLOR]

?>

<form action="?p=contact.php" method="post">
    <table width="100%">
    
        <tr>
            <td>Aanhef:</td>
            <td><select name="aanhef">
            <option>Dhr.</option>
            <option>Mvr.</option>
            </select>
        </tr>
        
        <tr>
            <td>Voornaam:</td>
            <td><input type="text" name="naam" /></td>
        </tr>
        
        <tr>
            <td>Achternaam:</td>
            <td><input type="text" name="achternaam" /></td>
        </tr>
        
        <tr>
            <td>Email:</td>
            <td><input type="text" name="email" /></td>
        </tr>
        
        <tr>
            <td>Onderwerp:</td>
            <td><input type="text" name="subject" /></td>
        </tr>
        
        <tr>
            <td valign="top">Bericht:</td>
            <td><textarea name="message" col="50" rows="10"></textarea></td>
      </tr>
    
        <tr>
            <td><input type="submit" name="send" value="Verstuur" /></td>
        </tr>
    </table>
</form>


Dit is een zeer simpele die wel gecontroleerd word op lege velden verder niks..
Jaartje geleden keer gemaakt..

Ik zou ook een uitgebreidde voor je kunnen maken voor 0.25 pt
0
Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lees mijn bericht $�*!
0
Berichten
515
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ok heb de eisen erin gezet + een controle op verkeerd e-mail adres.

Hier vraag je toch om?
0
Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ok¨¦, zo is het goed. Dank je!
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren