1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
| <?php
if ($_POST["submit"])
{
//db connectie:
mysql_connect("","","");
mysql_select_db(" ");
//de postings ophalen
$username = $_POST['name'];
$password = $_POST['pass'];
$voornaam = $_POST['voornaam'];
$tussenvoegsel = $_POST['tussenvoegsel'];
$achternaam = $_POST['achternaam'];
$adres = $_POST['adres'];
$postcode = $_POST['postcode'];
$woonplaats = $_POST['woonplaats'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$maillist = $_POST['maillist'];
$foto = $_POST['foto'];
$slogan = $_POST['slogan'];
$fotoDB = "user_images/$foto";
$mail1 = $_POST['mail1'];
$mail2 = $_POST['mail2'];
$mail3 = $_POST['mail3'];
$mail4 = $_POST['mail4'];
$mail5 = $_POST['mail5'];
$mail6 = $_POST['mail6'];
$mail7 = $_POST['mail7'];
$mail8 = $_POST['mail8'];
$mail9 = $_POST['mail9'];
$mail10 = $_POST['mail10'];
//een invoer maken van de maillist:
$mailtotal = "$mail1, $mail2, $mail3, $mail4, $mail5, $mail6, $mail7, $mail8, $mail9, $mail10";
//gegevens insert in de db:
mysql_query("INSERT INTO user (name, pass, voornaam, tussenvoegsel, achternaam, adres, postcode, woonplaats, email, tel, stemmen, rating, image, slogan, emails, maillist) VALUES ('".$username."','".$password."','".$voornaam."','".$tussenvoegsel."','".$achternaam."','".$adres."','".$postcode."','".$woonplaats."','".$email."','".$tel."','".$stemmen."','".$rating."','".$fotoDB."','".$slogan."','".$mailtotal."','".$maillist."')") or die(mysql_error());
[b]--------------------------------// top 5 ophalen:----------------------------------------------------------
//vars
$afbeeldingen = array() ;
//mysql - query
$query = mysql_query(" SELECT *
FROM user
WHERE stemmen > 0
ORDER BY rating
DESC LIMIT 5
");
//php / mysql - extract data en stop in array
while ( $output = mysql_fetch_assoc($query) ) {
for ($i=1; $i<6; $i++){
//array op nr
$afbeeldingen[$i] = $output['image'] ;
//array op naam
//$afbeeldingen[$output] = $output['image'] ;
}
}
//html weergeef
echo $afbeeldingen['1'] ; //weergeef afbeelding nummer 1
-----------------------------------------------------------------------------------------------------------[/b]
echo "gegevens opgeslagen, mails verstuurd, succes !";
//de email:
$message = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Win met Relax-in !</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
.text2 {
font-family: Arial;
font-size: 11px;
}
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link {
color: #025A8A;
}
a:visited {
color: #025A8A;
}
a:hover {
color: #025A8A;
text-decoration: none;
}
a:active {
color: #025A8A;
}
.style7 {font-family: Arial, Helvetica, sans-serif; font-size: 14; color: #025A8A; }
.style8 {font-family: Arial, Helvetica, sans-serif; font-size: 14; color: #025A8A; font-weight: bold; }
.style9 {
color: #025A8A;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: 22px;
}
.style19 {font-size: 20px}
.style20 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; color: #025A8A; font-weight: bold; }
-->
</style></head>
<body>
<table width="368" height="377" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">[img]"http://stud.cmd.hro.nl/0778490/jaar2/TUI/Mail/boven.jpg"[/img]</td>
</tr>
<tr>
<td width="362" height="172" align="left" valign="top" bgcolor="#FFFFFF"><h4 align="left" class="style7"><br />
Hé, </h4>
<h4 align="left" class="style7"> '.$voornaam.' heeft je zijn ultieme relaxte foto gestuurd. </h4>
<p align="left"><span class="style9"> Stem </span><span class="style9">nu</span><span class="style8"> op '.$voornaam.' zijn foto en zorg ervoor <br />
dat '.$voornaam.' een <span class="style19">mooie reis</span> wint. </span>
<p align="left" class="style20">Wacht niet langer en stem nu!
<p align="left" class="style8">Zelf een leuke foto? Surf naar <a href="http://stud.cmd.hro.nl/0778490/jaar2/TUI/Site/index.html" class="style8">www.relax-in.nl</a> en stuur ook uw ultieme relax moment in !</td>
<td width="365" bgcolor="#FFFFFF"><p class="style1"> </p>
<p>[img]"http://stud.cmd.hro.nl/0778490/jaar2/TUI/Site/'.$fotoDB.'"/><br[/img]
<br />
<br />
<a href="http://stud.cmd.hro.nl/0778490/jaar2/TUI/Site/user.php?SectionMain=Userfriend&name='.$username.'" class="style8">stem</a></p></td>
<td width="36" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="3" bgcolor="#FFFFFF">[img]"http://stud.cmd.hro.nl/0778490/jaar2/TUI/Mail/top5.jpg"[/img]
[b]------------------------------------------------------------------------------------------------------------------------------
Hier moeten die 5 plaatjes komen !!
-----------------------------------------------------------------------------------------------------------------------------[/b]
</td>
</tr>
<tr>
<td colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="3" bgcolor="#FFFFFF">[img]"http://stud.cmd.hro.nl/0778490/jaar2/TUI/Mail/onder.jpg"[/img]</td>
</tr>
</table>
</body>
</html>
';
//de email versturen:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: win@relax-in.nl' . "\r\n";
mail("$mail1", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail2", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail3", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail4", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail5", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail6", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail7", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail8", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail9", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
mail("$mail10", "$voornaam heeft zijn vakantie foto gestuurd !", "$message", "$headers");
} ?> |