ENTER in contactformulier

Gestart doorRubenmaxie20 reacties45 weergaven

21 berichten · pagina 1 van 2

Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heey,

Ik heb nu zegmaar een contactpagina, maar als ik nu een bericht
stuur via me contactpagina naar mezelf, dan staan er in het bericht geen
enters...

Weet iemand hoe ik dit kan oplossen? confused
Edit:
Ohja, en in het bericht staat dan i.p.v. de enter zoiets:

0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
maak er is
van
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
nltobr() geloof ik, dit zet de enters (/n) om in enters (
) zorg wel dat je de goede headers meegeeft aan de email (als je namelijk geen HTML headers erin hebt zal hij gewoon plaintext laten zien).
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guildjuhh:
nltobr() geloof ik, dit zet de enters thumbsdown om in enters (
) zorg wel dat je de goede headers meegeeft aan de email (als je namelijk geen HTML headers erin hebt zal hij gewoon plaintext laten zien).
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg nu deze foutmelding:

Fatal error: Call to undefined function nltobr() in /home/Ruben0/domains/oefenen.prutz0r.nl/public_html/contact_php.php on line 51
0
Berichten
6.201
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
omdat het nl2br() is yummie
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke, daar was ik net achter gekomen, toen je het zei. yummie
Maar nu heb ik nog 1 probleem, en dat is, dat dit gewoon niet werkt... confused
0
Berichten
6.201
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat is het probleem dan?
Wat werkt er niet?

Ik heb hier een contact-formulier voor mijn eigen site, en dat werkt uitstekend..
Voor 0,2 punten bouw ik hem in je site in yummie
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nou, ik heb nog steeds dat er rn staat in me bericht...

Wat ik er zelf aan toegevoegd heb met
werkt wel, maar wat de ander
naar mij toe wilt sturen niet.
En bedankt voor het aanbod, maar ik wil liever me eigen contactformulier houden... hypocritewink
0
Berichten
6.201
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hmmz..
Waarschijnlijk heb je wel iets wat hier op lijkt:

mail($ontvanger, $onderwerp, $bericht, $headers);

Doe dan eens:

mail($ontvanger, $onderwerp, nl2br($bericht), $headers);

Of had je dat al?
Anders doe je toch echt iets fout yummie
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke, ik zou het doen, maar dit is wat ik hiervoor kreeg, dus voor je laatste antwoord:
Afbeelding

Edit:

Me geweldig *uchum, uchum* code tot nu toe:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"header.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>
<html>
<head>
<style type="text/css">
<!--
h1 {
    font: 18pt;
}

h2 {
    font: 16pt;
}

textarea {
    height: 100px;
    width: 250px;
}

a {
    color: #0000FF;
    text-decoration: none;
}

a:hover {
    color: #0000FF;
    text-decoration: underline;
}
-->
</style>
<title>Untitled</title>
</head>
<body>
<h1>Navigatie</h1>
<a href="index.php">Home</a><br/>
<a href="login.php">Inloggen</a><br/>
<a href="register.php">Aanmelden</a><br/>
<a href="contact.php">Contact</a><br/><br/>
<hr width="100%">
[COLOR= #0000BB]<?php
$tijd[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]message[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$subject[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]subject[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" met het e-mailadres "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]).[/COLOR] [COLOR= #DD0000]" stuurde het volgende bericht:"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"n"[/COLOR] [COLOR= #007700].[/COLOR]
 [COLOR= #DD0000]"___________________________________________________________________"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"n"[/COLOR] [COLOR= #007700].[/COLOR] 
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"n"[/COLOR] [COLOR= #007700].[/COLOR]
 [COLOR= #DD0000]"___________________________________________________________________"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/nl2br"]nl2br[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]subject[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]message[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"U moet alle gegevens invullen!"[/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]"Uw mail is succesvol verzonden!"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"ruben.maxie@hotmail.com"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$subject[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];[/COLOR]
?>
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Ja, je doet nu niets met die nl2br($message);.
Als je regel 51 vervangt door dit:
$message = nl2br($message);
en je nog de goede headers meestuurt [ zie bericht van Guildjuhh ] dan werkt t wel.
0
Bas

Lid

Berichten
1.081
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
die mysql_real_escape_strings zijn volgens mij helemaal niet nodig als je geen mysql gebruikt
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
nee inderdaad, je kan beter dan htmlentities / htmlspecialchars gebruiken yummie
0
Rubenmaxie

Lid · Topicstarter

Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan wel, maar ik zet m toch maar neer smile
Edit:
En hij doet het nog steeds niet sadley
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