[PHP] Opensource Contactformulier

Gestart doorJeffreyy9 reacties30 weergaven

10 berichten · pagina 1 van 1

Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aangezien ik me eige toch verveel..
heb ik maar een contact formuliertje in elkaar gezet,
Je mag hem gebruiken, boeit me niet wat je dr mee doet, maar je mag hem niet verkopen.

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]])) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft niet alle velden ingevuld.[/COLOR][COLOR= #007700];
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$headers[/COLOR]  [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]MIME-Version: 1.0[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"
"[/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]"
"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #FF8000]// Mail[/COLOR]
        [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]
        <p>Er is een bericht gestuurd vanaf uw website.</p>
        <table>
            <tr>
                <td><strong>Naam:</strong></td>
                <td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>
            </tr>
            <tr>
                <td><strong>Afzender:</strong></td>
                <td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>
            </tr>
            <tr>
                <td><strong>Onderwerp:</strong></td>
                <td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>
            </tr>
            <tr>
                <td><strong>Bericht:</strong></td>
                <td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>
            </tr>
        </table>
        <hr>
        <p>Extra informatie</p>
        <table>
            <tr>
                <td><strong>Datum:</strong></td>
                <td>[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]j F Y H:i:s[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]</td>
            </tr>
            <tr>
                <td><strong>IP-Adres:</strong></td>
                <td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]remote_addr[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>
            </tr>
        </table>
        [/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #FF8000]// Mail versturen[/COLOR]
        [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]naam@domein.ext[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Uw bericht is succesvol verstuurd.[/COLOR][COLOR= #007700];
    }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
    <form action="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/getenv"]getenv[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]PHP_SELF[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]" method="post">
    <table>
        <tr>
            <td>Naam:</td>
            <td><input type="text" name="naam"></td>
        </tr>
        <tr>
            <td>E-mail adres:</td>
            <td><input type="text" name="email"></td>
        </tr>
        <tr>
            <td>Onderwerp:</td>
            <td><input type="text" name="onderwerp" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"></td>
        </tr>
        <tr>
            <td>Bericht:</td>
            <td><textarea style="width: 250px; height: 150px;" name="bericht"></textarea></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td><input type="submit" value="Verzenden"></td>
        </tr>
    </table>
    </form>
    [/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Leuk!
Hoef ik hem niet zelf meer te maken
Bedankt smile
0
Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Graag gedaan!
0
Berichten
46
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wauw, net wat ik nodig had biggrinDankje!
0
Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thanks, kan m goed gebruiken
0
Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Graag gedaan hoor, zon contactform is toch simpel xD
0
Berichten
6.722
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als je googlet kom je makkelijk nog 100 tegen.

Leuk smile Maar ik vind het altijd onhandig dat veel mensen bij die gratis scripts geen voorbeeld zetten.
0
Berichten
64
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wat moet ik aanpasse wi lhij de mail verznenden naar mij e-mail?
sorry, ben neit zo goed yummie
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Regel 43 aanpassen:

mail(naam@domein.ext, $_POST[onderwerp], $bericht, $headers);


naam@domein.ext naar je eigen e-mailadres.smile
0
Berichten
5.795
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
PHP_SELF is niet echt veilig
je kan het ook gewoon "" laten
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