Mail faal

Gestart doorMikeb89 reacties548 weergaven

90 berichten · pagina 3 van 6

Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
kijk die snap ik tenminste wel. ik zal van de week even kijken of het lukt aangezien ik nu toetsweek heb. confused
toevoeging op 28 juni 2012, 211922:
if($_SERVER[REQUEST_METHOD] == "POST"){
echo"

";
$user = $_GET[ref];
if($_POST[voornaam] == ""){
echo"U heeft geen voornaam ingevuld.";
}elseif($_POST[achternaam] == ""){
echo"U heeft geen achternaam ingevuld";
}elseif($_POST[email] == ""){
echo"Geen emailadres ingevuld!";
}else{
echo"Uw bestelling is succesvol ontvangen
Controleer uw email voor de factuur.
Let op! Refresh deze pagina niet.";
// subject
$subject = Uw bestelling op Cameramast.com;

// message
$message =


Bestelling op Cameramast.com

Geachte heer/mevrouw,

Bedankt voor de bestelling bij Cameramast.com

Hieronder vindt u een factuur met uw gegevens en de bestelde producten.

Gegevens:




































Bedrijf: $_POST[bedrijf];
Voornaam: $_POST[voornaam]
Achternaam:$_POST[achternaam]
Adres:$_POST[adres]
Postcode + Plaats:$_POST[postcode] $_POST[plaats]
Land:$_POST[land]
E-mail adres:$_POST
Telefoonnummer:$_POST[tel]
Mobiele nummer:$_POST[mob]
Kamer van Koophandel:$_POST[kvk]
BTW-nummer:$_POST[btw]


Factuur:
HIER MOET OOK EEN STUK PHP KOMEN, MAAR WERKT ALLEMAAL NIET :S


;

// To send HTML mail, the Content-type header must be set
$headers = MIME-Version: 1.0 . "rn";
$headers .= Content-type: text/html; charset=iso-8859-1 . "rn";

// Additional headers
$headers .= From: HOI . "rn";
$headers .= Bcc: HOI . "rn";

// Mail it
mail($_POST[email], $subject, $message, $headers);
?>
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
kijk die snap ik tenminste wel. ik zal van de week even kijken of het lukt aangezien ik nu toetsweek heb. confused
[COLOR= #0000BB]<?[/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/echo"]echo[/URL][COLOR= #DD0000]"<br><br>"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ref[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]voornaam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"U heeft geen voornaam ingevuld."[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]achternaam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"U heeft geen achternaam ingevuld"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/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/echo"]echo[/URL][COLOR= #DD0000]"Geen emailadres ingevuld!"[/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 bestelling is succesvol ontvangen<br />Controleer uw email voor de factuur.<br />Let op! Refresh deze pagina niet."[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]// subject[/COLOR]
[COLOR= #0000BB]$subject[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Uw bestelling op Cameramast.com[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]// message[/COLOR]
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]
<html>
<head>
<title>Bestelling op Cameramast.com</title>
</head>
<body>
<p>Geachte heer/mevrouw,<br />
<br />
Bedankt voor de bestelling bij Cameramast.com<br />
Hieronder vindt u een factuur met uw gegevens en de bestelde producten.<br />
<br /></p>
<p><b>Gegevens:</b></p><br />
<table border="0">
<tr>
<th>Bedrijf: </th><th>$_POST[bedrijf]</th>
</tr>
<tr>
<th>Voornaam: </th><th>$_POST[voornaam]</th>
</tr>
<tr>
<th>Achternaam:</th><th>$_POST[achternaam]</th>
</tr>
<tr>
<th>Adres:</th><th>$_POST[adres]</th>
</tr>
<tr>
<th>Postcode + Plaats:</th><th>$_POST[postcode] $_POST[plaats]</th>
</tr>
<tr>
<th>Land:</th><th>$_POST[land]</th>
</tr>
<tr>
<th>E-mail adres:</th><th>$_POST</th>
</tr>
<tr>
<th>Telefoonnummer:</th><th>$_POST[tel]</th>
</tr>
<tr>
<th>Mobiele nummer:</th><th>$_POST[mob]</th>
</tr>
<tr>
<th>Kamer van Koophandel:</th><th>$_POST[kvk]</th>
</tr>
<tr>
<th>BTW-nummer:</th><th>$_POST[btw]</th>
</tr>
</table><br /><br />
<b>Factuur:</b>
HIER MOET OOK EEN STUK PHP KOMEN, MAAR WERKT ALLEMAAL NIET :S
</body>
</html>
[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]// To send HTML mail, the Content-type header must be set[/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= #FF8000]// Additional headers[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]From: HOI <HOI@HOI.com>[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Bcc: HOI[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]// Mail it[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR]email[COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$subject[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$message[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]
?>


Ik weet niet wat ik fout doe, maar de PHP-codes doen het er niet in.
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik weet niet wat ik fout doe, maar de PHP-codes doen het er niet in.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
-Variabelen buiten quotes.
-single-quote in je $_POST variabelen.
- foutafhandeling op je mail()
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedoel je

$_POST[wat hier staat?];

Foutafhandeling?

En in de mail staan ook die $_POST[bedrijf] enzo maar die geeft gewoon $_POST[bedrijf] aan in de mail

toevoeging op 28 juni 2012, 21:46:32:
Dan geeft ie niks weer als ik $_POST[bedrijf] doe

toevoeging op 28 juni 2012, 21:47:24:
Ik bedoel een error:

Parse error: syntax error, unexpected bedrijf (T_STRING) in /BLABLA/billing.php on line 96
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Als je nou variabelen buiten je string haalt moet het werken.
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mmm, dus doen bijvoorbeeld:

$email = $_POST;

Zoiets dus? en dan in de html $email zetten ofzo?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dat verzin je zelf.... Gokken doe je in het casino, niet met PHP-scripten....

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Dit is een string"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]variabele[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]", en dit een string!"[/COLOR][COLOR= #007700];[/COLOR]
?>


Zo dus!
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oow yummie op die fiets yummie Ja wist ik veel yummie snapte er geen reet van van wat je zei... yummie
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dan had je ook kunnen Googlen. winkMet variabelen buiten quotes kwam ik al diverse tutorials tegen.
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg het niet voor elkaar. confused Hoe kan ik het dan het beste die variabele weergeven in dit stuk:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// subject[/COLOR]
[COLOR= #0000BB]$subject[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Uw bestelling op Cameramast.com[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]// message[/COLOR]
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]
<html>
<head>
<title>Bestelling op Cameramast.com</title>
</head>
<body>
<p>Geachte heer/mevrouw,<br />
<br />
Bedankt voor de bestelling bij Cameramast.com<br />
Hieronder vindt u een factuur met uw gegevens en de bestelde producten.<br />
<br /></p>
<p><b>Gegevens:</b></p><br />
<table border="0">
<tr>
<th>Bedrijf: </th><th>$_POST[bedrijf]</th>
</tr>
<tr>
<th>Voornaam: </th><th>$_POST[voornaam]</th>
</tr>
<tr>
<th>Achternaam:</th><th>$_POST[achternaam]</th>
</tr>
<tr>
<th>Adres:</th><th>$_POST[adres]</th>
</tr>
<tr>
<th>Postcode + Plaats:</th><th>$_POST[postcode] $_POST[plaats]</th>
</tr>
<tr>
<th>Land:</th><th>$_POST[land]</th>
</tr>
<tr>
<th>E-mail adres:</th><th>$_POST</th>
</tr>
<tr>
<th>Telefoonnummer:</th><th>$_POST[tel]</th>
</tr>
<tr>
<th>Mobiele nummer:</th><th>$_POST[mob]</th>
</tr>
<tr>
<th>Kamer van Koophandel:</th><th>$_POST[kvk]</th>
</tr>
<tr>
<th>BTW-nummer:</th><th>$_POST[btw]</th>
</tr>
</table><br /><br />
<b>Factuur:</b>
HIER MOET OOK EEN STUK PHP KOMEN, MAAR WERKT ALLEMAAL NIET :S
</body>
</html>
[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]// To send HTML mail, the Content-type header must be set[/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= #FF8000]// Additional headers[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]From: HOI <HOI@HOI.com>[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Bcc: HOI[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]// Mail it[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR]email[COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$subject[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$message[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
$_POST[btw] vervangen door: .$_POST[btw].

En de rest ook . voorzetten en . erachter.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Marvinguich schreef:
$_POST[btw] vervangen door: .$_POST[btw].

En de rest ook . voorzetten en . erachter.
En .$_POST[btw]. vervangen door:

.$_POST[btw].

en je bent helemaal klaar
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Okee bedankt!! Ik ga morgen even kijken aangezien ik nu in bed lig wink
toevoeging op 1 juli 2012, 14:06:24:
Daar ben ik weer..

Nu moet er een if in komen. Hoe kan ik dat doen?
Ook aan het begin . En aan het eind .?
Of moet het op een andere manier of kan dat gewoon niet?

toevoeging op 1 juli 2012, 14:06:25:
Daar ben ik weer..

Nu moet er een if in komen. Hoe kan ik dat doen?
Ook aan het begin . En aan het eind .?
Of moet het op een andere manier of kan dat gewoon niet?
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Daar ben ik weer..

Nu moet er een if in komen. Hoe kan ik dat doen?
Ook aan het begin . En aan het eind .?
Of moet het op een andere manier of kan dat gewoon niet?

toevoeging op 1 juli 2012, 14:07:40:
Omg ik faal..
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