fout in if opdracht
ik krijg elke keer een fout in me if opdracht
Notice: Undefined index: send in /storage/mijndomein/users/058605/public/sites/login.chat2you.eu/contact.php on line 20
Notice: Undefined index: send in /storage/mijndomein/users/058605/public/sites/login.chat2you.eu/contact.php on line 22
script is:
Code (php)
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
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
<?
include('menutop.php');
// geef e-mail adres op van ontvanger
$mail_ontv = "[email protected]";
// is niet 100% !!!
function checkmail($mail)
{
$email_host = explode("@", $mail);
$email_host = $email_host['1'];
$email_resolved = gethostbyname($email_host);
if ($email_resolved != $email_host && eregi("^[0-9a-z]([-_.~]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$mail))
$valid = 1;
return $valid;
}
// als er niet op submit is gedrukt, of als er wel op is gedrukt maar niet alles ingevoerd is
if (!$_POST['submit'] || $_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
if ($_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
echo "<font face=verdana size=2>Je bent je naam, e-mail adres, onderwerp of bericht vergeten in te vullen. Ook kan het zijn</font>";
echo "<font face=verdana size=2>dat je een verkeerd e-mail adres hebt ingevuld.</font><p>";
}
[/code]
iemand een oplossing hiervoor
alsvast bedankt
groetjes wesley
include('menutop.php');
// geef e-mail adres op van ontvanger
$mail_ontv = "[email protected]";
// is niet 100% !!!
function checkmail($mail)
{
$email_host = explode("@", $mail);
$email_host = $email_host['1'];
$email_resolved = gethostbyname($email_host);
if ($email_resolved != $email_host && eregi("^[0-9a-z]([-_.~]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$mail))
$valid = 1;
return $valid;
}
// als er niet op submit is gedrukt, of als er wel op is gedrukt maar niet alles ingevoerd is
if (!$_POST['submit'] || $_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
if ($_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
echo "<font face=verdana size=2>Je bent je naam, e-mail adres, onderwerp of bericht vergeten in te vullen. Ook kan het zijn</font>";
echo "<font face=verdana size=2>dat je een verkeerd e-mail adres hebt ingevuld.</font><p>";
}
[/code]
iemand een oplossing hiervoor
alsvast bedankt
groetjes wesley
Gewijzigd op 01/01/1970 01:00:00 door Stephan Sterrenberg
De foutmelding komt niet uit het weergegeven script. Wellicht de functie checkmail?
alleen die fout komt elke keer terug.
weet u misschien een oplossing hiervoor
De fout zit niet in dit script. Heb je de goede wel gepost. Er moet ergens het woordje 'send' te vinden zijn. En dat staat hier niet in.
het kan zijn dat die conflict geeft met het login stript
dat zit namelijk in het script wat die include
En wat staat er in menutop.php?
wat ik nu gepost heb is het menutop.php script
dit alles wat hier nu staat staat er in
afluist gedeelte staat in menubottom.php
Code (php)
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
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
<? session_start();?>
<html>
<head>
<title>>>>>>> My-Profile, The only one for you <<<<<<</title>
<meta name="description" content="My-Profile is the only for you">
<meta name="keywords" content="my-profile ,myprofile ,chatten ,praten ,webchat ,chat ,userplane ,2 you, 2you, chat, chat 2, chat 2 you, chat2, chat2you, chatbox, chat, chatbox, chat2you, chat2you.eu, chat2, 2you, camchat, camchatbox, chatmetcam, chatboxmetcam,">
<style>
td{
background-color: #FFFFCC;
}
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="red" vlink="red" alink="darkred" text="black" bgcolor="#000000">
<center>
<font face="Verdana" size="2">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="916" height="180">
<param name="movie" value="chat2youbanner.swf">
<param name="quality" value="Best">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<embed src="chat2youbanner.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="916" height="180" quality="Best" menu="false" wmode="transparent"></object>
</font>
</center>
<div align="center">
<table style="border-collapse: collapse;margin-left:0px;border-left:4px solid darkred;border-right:4px solid darkred; border-bottom:4px solid darkred;border-top:4px solid darkred;" bgcolor=darkred width=916>
<tr>
<th><a href=index.php><font color="#FFFFFF" face="Verdana" size="2"><span style="text-decoration: none">Home</span></font></a></th>
<th><a href=vragen.php><font color="#FFFFFF" face="Verdana" size="2"><span style="text-decoration: none">FAQ</span></font></a></th>
<th><font color="#FFFFFF" face="Verdana" size="2">Nieuws</font></th>
<th><font color="#FFFFFF" face="Verdana" size="2">Chat</font></th>
<th><font color="#FFFFFF" face="Verdana" size="2">Forum</font></th>
</tr>
</table>
<table border=0 style="border-collapse: collapse;margin-left:0px;border-left:4px solid darkred;border-right:4px solid darkred; border-bottom:4px solid darkred;border-top:0px solid darkred;" cellpadding="0" width="916" border="0"><tr>
<td width="15%" valign="top"><font face="Verdana" size="2"><?
error_reporting(E_ALL);
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
$date = (date("d-m-Y H:i:s"));
mysql_query("UPDATE tbl_users SET user_lastactive = '$date' WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
//setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Login Incorrect.'); document.location.href=('index.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
$_SESSION['user_id'] = $user_id;
echo "<script>document.location.href=('index.php') </script>";
}
}
else
{
?>
</font>
<table cellspacing="1"><tr><form method="POST">
<font face="Verdana" size="4">
<input type="hidden" value="1" name="login"></font><td>
<font size=2 face="Verdana">Gebruikersnaam :</font></td></tr><tr><td>
<font face="Verdana" size="4"><input type="text" name="user" size="17"></font></td></tr>
<tr><td><font size=2 face="Verdana">Wachtwoord :</font></td></tr><tr><td>
<font face="Verdana" size="4"><input type="password" name="pass" size="17"></font></td></tr>
<tr><td collspan=2><font face="Verdana" size="4"><input type="Submit" value="Aanmelden"></font></td></form></tr>
</table>
<font face="Verdana" size="2">
<img src="icons/register.gif"> <a href="register.php">
<span style="text-decoration: none">Registreren</span></a><br>
<img src="icons/memberlist.gif"> <a href="memberlist.php">
<span style="text-decoration: none">Gebruikerslijst</span></a>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "<font size=2>Gebruikersnaam : <b>" . $row['user_name']. "</b></font>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font size=2 color=\"#008000\">Leeg</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font size=2 color=\"#FF0000\">Vol</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "<font size=2>Postvak IN : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\"><font size=2 color=red><span style=\"text-decoration: none\">Open</span></font></a> )</font>";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"icons/admin.gif\"> <a href=\"admin.php\"><font size=2 color=red><span style=\"text-decoration: none\">Admin Pagina</span></font></a>";
echo "<br>\n";
}
echo "<img src=\"icons/memberlist.gif\"> <a href=\"memberlist.php\"><font size=2 color=red><span style=\"text-decoration: none\">Gebruikerslijst</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"foto.php?act=foto_uploaden\"><font size=2 color=red><span style=\"text-decoration: none\">Foto wijzigen</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\"><font size=2 color=red><span style=\"text-decoration: none\">Wijzig Profiel</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\"><font size=2 color=red><span style=\"text-decoration: none\">Mijn Profiel</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/logoff.gif\"> <a href=\"logoff.php\"><font size=2 color=red><span style=\"text-decoration: none\">Afmelden</span></font></a><br> ";
}
?>
</font>
</td>
<td valign="top">
<font face="Verdana" size="2">
<html>
<head>
<title>>>>>>> My-Profile, The only one for you <<<<<<</title>
<meta name="description" content="My-Profile is the only for you">
<meta name="keywords" content="my-profile ,myprofile ,chatten ,praten ,webchat ,chat ,userplane ,2 you, 2you, chat, chat 2, chat 2 you, chat2, chat2you, chatbox, chat, chatbox, chat2you, chat2you.eu, chat2, 2you, camchat, camchatbox, chatmetcam, chatboxmetcam,">
<style>
td{
background-color: #FFFFCC;
}
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="red" vlink="red" alink="darkred" text="black" bgcolor="#000000">
<center>
<font face="Verdana" size="2">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="916" height="180">
<param name="movie" value="chat2youbanner.swf">
<param name="quality" value="Best">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<embed src="chat2youbanner.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="916" height="180" quality="Best" menu="false" wmode="transparent"></object>
</font>
</center>
<div align="center">
<table style="border-collapse: collapse;margin-left:0px;border-left:4px solid darkred;border-right:4px solid darkred; border-bottom:4px solid darkred;border-top:4px solid darkred;" bgcolor=darkred width=916>
<tr>
<th><a href=index.php><font color="#FFFFFF" face="Verdana" size="2"><span style="text-decoration: none">Home</span></font></a></th>
<th><a href=vragen.php><font color="#FFFFFF" face="Verdana" size="2"><span style="text-decoration: none">FAQ</span></font></a></th>
<th><font color="#FFFFFF" face="Verdana" size="2">Nieuws</font></th>
<th><font color="#FFFFFF" face="Verdana" size="2">Chat</font></th>
<th><font color="#FFFFFF" face="Verdana" size="2">Forum</font></th>
</tr>
</table>
<table border=0 style="border-collapse: collapse;margin-left:0px;border-left:4px solid darkred;border-right:4px solid darkred; border-bottom:4px solid darkred;border-top:0px solid darkred;" cellpadding="0" width="916" border="0"><tr>
<td width="15%" valign="top"><font face="Verdana" size="2"><?
error_reporting(E_ALL);
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
$date = (date("d-m-Y H:i:s"));
mysql_query("UPDATE tbl_users SET user_lastactive = '$date' WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
//setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Login Incorrect.'); document.location.href=('index.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
$_SESSION['user_id'] = $user_id;
echo "<script>document.location.href=('index.php') </script>";
}
}
else
{
?>
</font>
<table cellspacing="1"><tr><form method="POST">
<font face="Verdana" size="4">
<input type="hidden" value="1" name="login"></font><td>
<font size=2 face="Verdana">Gebruikersnaam :</font></td></tr><tr><td>
<font face="Verdana" size="4"><input type="text" name="user" size="17"></font></td></tr>
<tr><td><font size=2 face="Verdana">Wachtwoord :</font></td></tr><tr><td>
<font face="Verdana" size="4"><input type="password" name="pass" size="17"></font></td></tr>
<tr><td collspan=2><font face="Verdana" size="4"><input type="Submit" value="Aanmelden"></font></td></form></tr>
</table>
<font face="Verdana" size="2">
<img src="icons/register.gif"> <a href="register.php">
<span style="text-decoration: none">Registreren</span></a><br>
<img src="icons/memberlist.gif"> <a href="memberlist.php">
<span style="text-decoration: none">Gebruikerslijst</span></a>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "<font size=2>Gebruikersnaam : <b>" . $row['user_name']. "</b></font>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font size=2 color=\"#008000\">Leeg</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font size=2 color=\"#FF0000\">Vol</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "<font size=2>Postvak IN : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\"><font size=2 color=red><span style=\"text-decoration: none\">Open</span></font></a> )</font>";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"icons/admin.gif\"> <a href=\"admin.php\"><font size=2 color=red><span style=\"text-decoration: none\">Admin Pagina</span></font></a>";
echo "<br>\n";
}
echo "<img src=\"icons/memberlist.gif\"> <a href=\"memberlist.php\"><font size=2 color=red><span style=\"text-decoration: none\">Gebruikerslijst</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"foto.php?act=foto_uploaden\"><font size=2 color=red><span style=\"text-decoration: none\">Foto wijzigen</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\"><font size=2 color=red><span style=\"text-decoration: none\">Wijzig Profiel</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\"><font size=2 color=red><span style=\"text-decoration: none\">Mijn Profiel</span></font></a>";
echo "<br>\n";
echo "<img src=\"icons/logoff.gif\"> <a href=\"logoff.php\"><font size=2 color=red><span style=\"text-decoration: none\">Afmelden</span></font></a><br> ";
}
?>
</font>
</td>
<td valign="top">
<font face="Verdana" size="2">
Gewijzigd op 01/01/1970 01:00:00 door Stephan Sterrenberg
Staat ook geen 'send' in.
zonder die include doet die het wel goed
zonder fouten
maar dan past die niet in de site
config.php
functions.php
weet ik bijna 100% zeker
en function is voor smilies en andere opties zoals code hier
ben de naam ff kwijt hoe het heet
grotendeels javascript enzo
wil ze wel ff posten hier als je dat wil
Gewijzigd op 01/01/1970 01:00:00 door Stephan Sterrenberg
Zet daar eens op de eerste regel
$valid = 0;
Nee, goed lezen, nu staat er 'submit'.
Zet eens hier de hele contact pagina, of de stukken code tussen lijn 19 en 30.
Code (php)
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
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
<?
include('menutop.php');
// geef e-mail adres op van ontvanger
$mail_ontv = "[email protected]";
// is niet 100% !!!
function checkmail($mail)
{
$valid = 0;
$email_host = explode("@", $mail);
$email_host = $email_host['1'];
$email_resolved = gethostbyname($email_host);
if ($email_resolved != $email_host && eregi("^[0-9a-z]([-_.~]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$mail))
$valid = 1;
return $valid;
}
// als er niet op submit is gedrukt, of als er wel op is gedrukt maar niet alles ingevoerd is
if (!$_POST['submit'] || $_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
if ($_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
echo "<font face=verdana size=2>Je bent je naam, e-mail adres, onderwerp of bericht vergeten in te vullen. Ook kan het zijn</font>";
echo "<font face=verdana size=2>dat je een verkeerd e-mail adres hebt ingevuld.</font><p>";
}
// form + tabel
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<form method=\"POST\" ACTION=\"contact.php\">";
// naam
echo "<tr><td><font face=verdana size=2>Naam:</font></td>";
echo "<td><input type=\"text\" name=\"naam\"></td></tr>";
// space
echo "<tr><td> </td></tr>";
// mail
echo "<tr><td><font face=verdana size=2>E-mail adres:</font></td>";
echo "<td><input type=\"text\" name=\"mail\"></td></tr>";
// space
echo "<tr><td> </td></tr>";
// mail
echo "<tr><td><font face=verdana size=2>Onderwerp:</font></td>";
echo "<td><input type=\"text\" name=\"onderwerp\"></td></tr>";
// space
echo "<tr><td> </td></tr>";
// mail
echo "<tr><td><font face=verdana size=2>Bericht:</font></td>";
echo "<td><TEXTAREA name=\"msggs\" ROWS=\"6\" COLS=\"45\"></TEXTAREA></td></tr>";
// space
echo "<tr><td> </td></tr>";
// button
echo "<tr><td> </td></tr>";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"Versturen\"></td></tr>";
// sluit form + tabel
echo "</form>";
echo "</table>";
}
// versturen naar
else
{
// set datum
$datum = date("d.m.Y H:i");
// set ip
$ip = $_SERVER['REMOTE_ADDR'];
$inhoud_mail = "===================================================\n";
$inhoud_mail .= "Ingevulde contact formulier\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= "Naam: " . $_POST['naam'] . "\n";
$inhoud_mail .= "E-mail adres: " . $_POST['mail'] . "\n";
$inhoud_mail .= "Bericht:\n";
$inhoud_mail .= $_POST['msggs'] . "\n\n";
$inhoud_mail .= "Verstuurd op $datum via het ip " . $ip . "\n\n";
$inhoud_mail .= "===================================================\n\n";
// --------------------
// spambot protectie
// ------
// van de tutorial: http://www.phphulp.nl/php/tutorials/10/340/
// ------
$headers = "From: " . $_POST['naam'] . " <" . $_POST['mail'] . ">";
$headers = stripslashes($headers);
$headers = str_replace("\n", "", $headers); // Verwijder \n
$headers = str_replace("\r", "", $headers); // Verwijder \r
$headers = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $headers)); // Slashes van quotes
$_POST['onderwerp'] = str_replace("\n", "", $_POST['onderwerp']); // Verwijder \n
$_POST['onderwerp'] = str_replace("\r", "", $_POST['onderwerp']); // Verwijder \r
$_POST['onderwerp'] = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $_POST['onderwerp'])); // Slashes van quotes
mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers);
echo "<p><font face=verdana size=2><b>Je e-mail is verstuurd</b></font></p>";
echo "<p><font face=verdana size=2>Bedankt voor het versturen van een e-mail. Je zult snel een antwoord ";
echo "krijgen indien dit nodig is.</font></p>";
echo "<p><font face=verdana size=2>We nemen alles serieus en zullen vertrouwelijk omgaan met de informatie ";
echo "die we binnen krijgen. Je e-mail adres zal nooit aan derden worden verstrekt.</font></p>";
}
include('menubottom.php');
?>
include('menutop.php');
// geef e-mail adres op van ontvanger
$mail_ontv = "[email protected]";
// is niet 100% !!!
function checkmail($mail)
{
$valid = 0;
$email_host = explode("@", $mail);
$email_host = $email_host['1'];
$email_resolved = gethostbyname($email_host);
if ($email_resolved != $email_host && eregi("^[0-9a-z]([-_.~]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$mail))
$valid = 1;
return $valid;
}
// als er niet op submit is gedrukt, of als er wel op is gedrukt maar niet alles ingevoerd is
if (!$_POST['submit'] || $_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
if ($_POST['submit'] && (!$_POST['naam'] || !$_POST['mail'] || !checkmail($_POST['mail']) || !$_POST['msggs'] || !$_POST['onderwerp']))
{
echo "<font face=verdana size=2>Je bent je naam, e-mail adres, onderwerp of bericht vergeten in te vullen. Ook kan het zijn</font>";
echo "<font face=verdana size=2>dat je een verkeerd e-mail adres hebt ingevuld.</font><p>";
}
// form + tabel
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<form method=\"POST\" ACTION=\"contact.php\">";
// naam
echo "<tr><td><font face=verdana size=2>Naam:</font></td>";
echo "<td><input type=\"text\" name=\"naam\"></td></tr>";
// space
echo "<tr><td> </td></tr>";
echo "<tr><td><font face=verdana size=2>E-mail adres:</font></td>";
echo "<td><input type=\"text\" name=\"mail\"></td></tr>";
// space
echo "<tr><td> </td></tr>";
echo "<tr><td><font face=verdana size=2>Onderwerp:</font></td>";
echo "<td><input type=\"text\" name=\"onderwerp\"></td></tr>";
// space
echo "<tr><td> </td></tr>";
echo "<tr><td><font face=verdana size=2>Bericht:</font></td>";
echo "<td><TEXTAREA name=\"msggs\" ROWS=\"6\" COLS=\"45\"></TEXTAREA></td></tr>";
// space
echo "<tr><td> </td></tr>";
// button
echo "<tr><td> </td></tr>";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"Versturen\"></td></tr>";
// sluit form + tabel
echo "</form>";
echo "</table>";
}
// versturen naar
else
{
// set datum
$datum = date("d.m.Y H:i");
// set ip
$ip = $_SERVER['REMOTE_ADDR'];
$inhoud_mail = "===================================================\n";
$inhoud_mail .= "Ingevulde contact formulier\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= "Naam: " . $_POST['naam'] . "\n";
$inhoud_mail .= "E-mail adres: " . $_POST['mail'] . "\n";
$inhoud_mail .= "Bericht:\n";
$inhoud_mail .= $_POST['msggs'] . "\n\n";
$inhoud_mail .= "Verstuurd op $datum via het ip " . $ip . "\n\n";
$inhoud_mail .= "===================================================\n\n";
// --------------------
// spambot protectie
// ------
// van de tutorial: http://www.phphulp.nl/php/tutorials/10/340/
// ------
$headers = "From: " . $_POST['naam'] . " <" . $_POST['mail'] . ">";
$headers = stripslashes($headers);
$headers = str_replace("\n", "", $headers); // Verwijder \n
$headers = str_replace("\r", "", $headers); // Verwijder \r
$headers = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $headers)); // Slashes van quotes
$_POST['onderwerp'] = str_replace("\n", "", $_POST['onderwerp']); // Verwijder \n
$_POST['onderwerp'] = str_replace("\r", "", $_POST['onderwerp']); // Verwijder \r
$_POST['onderwerp'] = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $_POST['onderwerp'])); // Slashes van quotes
mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers);
echo "<p><font face=verdana size=2><b>Je e-mail is verstuurd</b></font></p>";
echo "<p><font face=verdana size=2>Bedankt voor het versturen van een e-mail. Je zult snel een antwoord ";
echo "krijgen indien dit nodig is.</font></p>";
echo "<p><font face=verdana size=2>We nemen alles serieus en zullen vertrouwelijk omgaan met de informatie ";
echo "die we binnen krijgen. Je e-mail adres zal nooit aan derden worden verstrekt.</font></p>";
}
include('menubottom.php');
?>