Mail faal

Gestart doorMikeb89 reacties548 weergaven

90 berichten · pagina 1 van 6

Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Okee, deze code werkt niet:

[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]"
"[/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]// Additional headers[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]From: HOI <HOI@HOI.com>[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"
"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Bcc: HOI[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"
"[/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
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
haal de $result es weg?

toevoeging op 21 juni 2012, 22:30:08:
Zo:

12: mysql_query("insert into customers(bedrijf, voornaam, achternaam, email, adres, postcode, plaats, land, tel, mob, kvk, btw) values($_POST[bedrijf],$_POST[voornaam],$_POST[achternaam],$_POST,$_POST[adres],$_POST[postcode],$_POST[plaats],$_POST[land],$_POST[tel],$_POST[mob],$_POST[kvk],$_POST[btw])");

15: mysql_query("insert into orders values(,$date,$customerid)");
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Trouwens, SQL injection is mogelijk.
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt voor de reacties.

@nielsjojo
Alleen customers wordt niet in de db gezet.

@sebastiaanh
Hoe kan ik dat beveiligen?

toevoeging op 22 juni 2012, 09:25:53:
En de afzender wordt trouwens ook niet weergegeven in de mail.
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dmv mysql_real_escape_string
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Okee, ik zal eens kijken smile Weet je ook toevallig hoe ik het goede email adres moet weergeven? want nu staat er in de mailbox wel de afzender, en als ik het mailtje open staat er:
mikeb@....com namens info@....com

En hoe ik het in de db moet krijgen, die customers. yummie
toevoeging op 22 juni 2012, 09:34:27:
Ik heb nu dit:

[COLOR= #0000BB]<?php
$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"insert into customers(bedrijf, voornaam, achternaam, email, adres, postcode, plaats, land, tel, mob, kvk, btw) values($_POST[bedrijf],$_POST[voornaam],$_POST[achternaam],$_POST[email],$_POST[adres],$_POST[postcode],$_POST[plaats],$_POST[land],$_POST[tel],$_POST[mob],$_POST[kvk],$_POST[btw])"[/COLOR][COLOR= #007700]);[/COLOR]        [COLOR= #0000BB]$customerid[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_insert_id"]mysql_insert_id[/URL][COLOR= #007700]();[/COLOR]
        [COLOR= #0000BB]$date[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"insert into orders values(,$date,$customerid)"[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$orderid[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_insert_id"]mysql_insert_id[/URL][COLOR= #007700]();[/COLOR]
        
        [COLOR= #0000BB]$max[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cart[/COLOR][COLOR= #007700]]);[/COLOR]
        [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][COLOR= #0000BB]$max[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++){[/COLOR]
            [COLOR= #0000BB]$pid[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cart[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]productid[/COLOR][COLOR= #007700]];[/COLOR]
            [COLOR= #0000BB]$q[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cart[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]qty[/COLOR][COLOR= #007700]];[/COLOR]
            [COLOR= #0000BB]$price[/COLOR][COLOR= #007700]=[/COLOR]get_price[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pid[/COLOR][COLOR= #007700]);[/COLOR]
            [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"insert into order_detail values ($orderid,$pid,$q,$price)"[/COLOR][COLOR= #007700]);[/COLOR]
                      [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]);[/COLOR]

?>


Is dat goed?

toevoeging op 22 juni 2012, 09:35:04:
Ik ben echt noob met php yummie
toevoeging op 22 juni 2012, 09:35:53:
Heuhh, email doet het nu smile
toevoeging op 22 juni 2012, 09:40:13:
Dus alleen nog de customers. wink En dan werkt het, tenzij de beveiliging niet goed is volgens sebastiaan yummie
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Even een paar tips:
- Variabelen in je query moeten buiten quotes (lees meer...)
- Beveilig je POST/GET/COOKIE in je query met mysql_real_escape_string. (lees meer...)
- Voeg foutafhandeling toe aan je query, zeer handig bij het oplossen van problemen waarbij niks in/naar je database wordt uitgevoerd. (lees meer...)
- Gebruik DATETIME als je een datum in de database opslaat. (lees meer...)
- Zorg voor leesbare querys, bij voorkeur plaats je alle standaard MySQL functies (INSERT INTO, SELECT, WHERE etc..) in hoofdletters, en bij nog meer voorkeur hak je de querie op in Enters, zodat het beter leesbaar is, zo kan je ziet of je een komma teveel hebt in een SELECT.
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb iets anders bedacht waardoor het niet in een database hoeft winkIk wil nu gewoon een mail sturen naar een email adres.
dat gaat dus via de $inh = tekstblabalbalbala
Hoe kan ik het doen dat er een klein stukje in de $inh dikgedrukt wordt? aangezien niet werkt. confused Heb al gezocht op internet en kan het niet vinden. Kan ook zijn dat ik scheel ben, want het zal best op internet staan. wink
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Mikeb schreef:
Ik heb iets anders bedacht waardoor het niet in een database hoeft winkIk wil nu gewoon een mail sturen naar een email adres.
dat gaat dus via de $inh = tekstblabalbalbala
Hoe kan ik het doen dat er een klein stukje in de $inh dikgedrukt wordt? aangezien niet werkt. confused Heb al gezocht op internet en kan het niet vinden. Kan ook zijn dat ik scheel ben, want het zal best op internet staan. wink
Wat is je script nu?
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bijna hetzelfde nog wink
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?
$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO customers(bedrijf, voornaam, achternaam, email, adres, postcode, plaats, land, tel, mob, kvk, btw) VALUES ("[/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]bedrijf[/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]voornaam[/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]achternaam[/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]adres[/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]postcode[/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]plaats[/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]land[/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]tel[/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]mob[/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]kvk[/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]btw[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Was niet meer nodig. Ik ga het niet meer in mijn db opslaan maar gaat gewoon via mail wink
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
$result = mysql_query("insert into customers(bedrijf, voornaam, achternaam, email, adres, postcode, plaats, land, tel, mob, kvk, btw) values($_POST[bedrijf],$_POST[voornaam],$_POST[achternaam],$_POST[email],$_POST[adres],$_POST[postcode],$_POST[plaats],$_POST[land],$_POST[tel],$_POST[mob],$_POST[kvk],$_POST[btw])");        $customerid=mysql_insert_id();
        $date=date(Y-m-d);
        $result = mysql_query("insert into orders values(,$date,$customerid)");
                mysql_real_escape_string($result);
        $orderid=mysql_insert_id();
        
        $max=count($_SESSION[cart]);
        for($i=0;$i<$max;$i++){
            $pid=$_SESSION[cart][$i][productid];
            $q=$_SESSION[cart][$i][qty];
            $price=get_price($pid);
            $result = mysql_query("insert into order_detail values ($orderid,$pid,$q,$price)");
                      mysql_real_escape_string($result);


nu post je geen mail?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
$result = mysql_query("insert into customers(bedrijf, voornaam, achternaam, email, adres, postcode, plaats, land, tel, mob, kvk, btw) values($_POST[bedrijf],$_POST[voornaam],$_POST[achternaam],$_POST[email],$_POST[adres],$_POST[postcode],$_POST[plaats],$_POST[land],$_POST[tel],$_POST[mob],$_POST[kvk],$_POST[btw])");        $customerid=mysql_insert_id();
        $date=date(Y-m-d);
        $result = mysql_query("insert into orders values(,$date,$customerid)");
                mysql_real_escape_string($result);
        $orderid=mysql_insert_id();
        
        $max=count($_SESSION[cart]);
        for($i=0;$i<$max;$i++){
            $pid=$_SESSION[cart][$i][productid];
            $q=$_SESSION[cart][$i][qty];
            $price=get_price($pid);
            $result = mysql_query("insert into order_detail values ($orderid,$pid,$q,$price)");
                      mysql_real_escape_string($result);
nu post je geen mail?

In zijn script wel emoEn jouw code is fout, alweer.
0
Mikeb

Lid · Topicstarter

Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb hieronder weer een deel van de pagina, dit is het belangrijkste deel.
Op regel 17 staat het woord gegevens. deze moet dikgedrukt worden. wink
(code)
[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."[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$van[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"$afzendermail"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$to[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$ow[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Bestelling"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$inh[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Geachte heer/mevrouw,nBedankt voor de bestelling bij WEBSITE.comnHieronder vindt u een factuur met uw gegevens en de bestelde producten:nn
Gegevens:nBedrijf: $_POST[bedrijf]nVoornaam: $_POST[voornaam]nAchternaam: $_POST[achternaam]n Emailadres: $_POST[email]nAdres: $_POST[adres]nPostcode: $_POST[postcode]nPlaats: $_POST[plaats]nLand: $_POST[land]nTelefoonnummer: $_POST[tel]nMobiele nummer: $_POST[mob]nKamer van Koophandel: $_POST[kvk]nBTW-nummer: $_POST[btw]"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$success[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$to[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$ow[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$inh[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"From: <$van>"[/COLOR][COLOR= #007700]);[/COLOR]
                [COLOR= #0000BB]$customerid[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_insert_id"]mysql_insert_id[/URL][COLOR= #007700]();[/COLOR]
        [COLOR= #0000BB]$date[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"insert into orders values(,$date,$customerid)"[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$orderid[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_insert_id"]mysql_insert_id[/URL][COLOR= #007700]();[/COLOR]
        
        [COLOR= #0000BB]$max[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cart[/COLOR][COLOR= #007700]]);[/COLOR]
        [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][COLOR= #0000BB]$max[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++){[/COLOR]
            [COLOR= #0000BB]$pid[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cart[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]productid[/COLOR][COLOR= #007700]];[/COLOR]
            [COLOR= #0000BB]$q[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cart[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]qty[/COLOR][COLOR= #007700]];[/COLOR]
            [COLOR= #0000BB]$price[/COLOR][COLOR= #007700]=[/COLOR]get_price[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pid[/COLOR][COLOR= #007700]);[/COLOR]
            [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"insert into order_detail values ($orderid,$pid,$q,$price)"[/COLOR][COLOR= #007700]);[/COLOR]
                      [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]);
}}}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
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