Ik moet mijn e-mail aders invoeren en dan moet hij hem opslaan in de db en dan kan ik later een nieuwsbrief versturen.
Alleen als ik het e-mail aders invoer en klik op verstuur dan doet hij niets
..
Dit is de code:
( sorry voor de lange code )
Kan iemand mij uitleggen hoe ik dat kan verhelpen
Alleen als ik het e-mail aders invoer en klik op verstuur dan doet hij niets
..Dit is de code:
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]settings.php[/COLOR][COLOR= #007700]);[/COLOR] ?>
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]memberid[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<meta http-equiv="refresh" content="0;URL=index.php">"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];
}[/COLOR]
?>
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]nieuwsbriefgegevens.php[/COLOR][COLOR= #007700]);[/COLOR] ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="images/style.css" />
<title>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"$head"[/COLOR][COLOR= #007700];[/COLOR] ?></title>
</head>
<body>
<div id="content">
<div class="header">
<h1><a href="#">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"$head"[/COLOR][COLOR= #007700];[/COLOR] ?></a></h1>
</div>
<div class="subheader">
<div class="subheader_right">
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]menu.php[/COLOR][COLOR= #007700]);[/COLOR] ?> </div>
<div class="subheader_left"> <a href="#">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"$menuhead2"[/COLOR][COLOR= #007700];[/COLOR] ?></a> </div>
</div>
<div class="right">
<div class="info"> <a class="info" href="#nogo">Betaalde aanmeldingen</a></div>
<p>Hier kun je credits verdienen door op banners te klikken.<br />
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/getenv"]getenv[/URL][COLOR= #007700]([/COLOR]HTTP_X_FORWARDED_FOR[COLOR= #007700])) {[/COLOR] [COLOR= #0000BB]$IPadres[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/getenv"]getenv[/URL][COLOR= #007700]([/COLOR]HTTP_X_FORWARDED_FOR[COLOR= #007700]); }[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/getenv"]getenv[/URL][COLOR= #007700]([/COLOR]HTTP_CLIENT_IP[COLOR= #007700])) {[/COLOR] [COLOR= #0000BB]$IPadres[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/getenv"]getenv[/URL][COLOR= #007700]([/COLOR]HTTP_CLIENT_IP[COLOR= #007700]); }[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [COLOR= #0000BB]$IPadres[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$REMOTE_ADDR[/COLOR][COLOR= #007700]; }[/COLOR]
[COLOR= #FF8000]// Begin functie om het e-mail adres te controleren[/COLOR]
[COLOR= #007700]function[/COLOR] ControleerEmail[COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/ereg"]ereg[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"[A-Za-z0-9_-]+([.]{1}[A-Za-z0-9_-]+)*@[A-Za-z0-9-]+([.]{1}[A-Za-z0-9-]+)+"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$a[/COLOR][COLOR= #007700]);
}[/COLOR]
[COLOR= #FF8000]// Einde functie om het e-mail adres te controleren[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actie[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"aanmelden"[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]|| ![/COLOR]ControleerEmail[COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres is ongeldig!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(Datum) FROM Nieuwsbrief WHERE Adres = $email"[/COLOR][COLOR= #007700]),[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres staat al in de lijst!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]100000[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]999999[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO Nieuwsbrief VALUES($email,"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"U"[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]",$IPadres,$code)"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"$email"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Bevestigen nieuwsbrief $JouwWebsiteNaam"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Beste eigenaar van $email,
U of iemand anders heeft dit e-mail adres aangemeld bij de nieuwsbrief van $JouwWebsiteNaam.
Klik hier om de aanmelding te bevestigen:
$NieuwsbriefLocatie?actie=bevestigen&email=$email&code=$code
$JouwWebsiteNaam"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"From: $JouwWebsiteNaam <$JouwEmail>"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Er is een e-mail naar $email gestuurd. Klik op de link in de nieuwsbrief om de aanmelding te bevestigen.</b><br><br>"[/COLOR][COLOR= #007700]);
}
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actie[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"bevestigen"[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]|| ![/COLOR]ControleerEmail[COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres is ongeldig!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700](!@[/COLOR][URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(Adres) FROM Nieuwsbrief WHERE Adres = $email"[/COLOR][COLOR= #007700]),[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres is niet gevonden!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$cd[/COLOR] [COLOR= #007700]= @[/COLOR][URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT Activeren FROM Nieuwsbrief WHERE Adres = $email"[/COLOR][COLOR= #007700]),[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Activeren"[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het aanmelden is al bevestigd!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$cd[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>De activeringscode is onjuist!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE Nieuwsbrief SET Activeren = 0 WHERE Adres = $email"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"$email"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Aanmelding nieuwsbrief $JouwWebsiteNaam"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Beste eigenaar van $email,
Bedankt voor het bevestigen. U zult vanaf nu de nieuwsbrief van $JouwWebsiteNaam ontvangen.
Afmelden kan op $NieuwsbriefLocatie.
$JouwWebsiteNaam"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"From: $JouwWebsiteNaam <$JouwEmail>"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het aanmelden is succesvol bevestigd! Ter bevestiging is een e-mail gestuurd.</b><br><br>"[/COLOR][COLOR= #007700]);
}
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actie[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"afmelden"[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]|| ![/COLOR]ControleerEmail[COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres is ongeldig!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700](!@[/COLOR][URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(Adres) FROM Nieuwsbrief WHERE Adres = $email"[/COLOR][COLOR= #007700]),[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres is niet gevonden!</b><br><br>"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM Nieuwsbrief WHERE Adres = $email"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"$email"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Afmelding nieuwsbrief $JouwWebsiteNaam"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Beste eigenaar van $email,
U of iemand anders heeft dit e-mail adres afgemeld bij de nieuwsbrief van $JouwWebsiteNaam. Wilt u de nieuwsbrief weer ontvangen, ga dan naar $NieuwsbriefLocatie.
$JouwWebsiteNaam"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"From: $JouwWebsiteNaam <$JouwEmail>"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<b>Het e-mail adres is succesvol afgemeld! Ter bevestiging is een e-mail gestuurd.</b><br><br>"[/COLOR][COLOR= #007700]);
}
}[/COLOR]
?>
<form method=post action=>
E-mail adres: <input type=text name=email><br>
<input type=radio name=actie value=aanmelden checked> Aanmelden
<input type=radio name=actie value=afmelden> Afmelden<br>
<input type=submit value=Verstuur>
</form>
</p>
<p> </p>
</div>
<div class="left">
<h2>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"$menu2content"[/COLOR][COLOR= #007700];[/COLOR] ?></h2>
<p>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]menu2.php[/COLOR][COLOR= #007700]);[/COLOR] ?></p>
</div>
<div class="footer">
<p>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]banner.php[/COLOR][COLOR= #007700]);[/COLOR] ?><br>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"$copy"[/COLOR][COLOR= #007700];[/COLOR] ?></p>
</div>
</div>
</body>
</html> ( sorry voor de lange code )
Kan iemand mij uitleggen hoe ik dat kan verhelpen
