Onbekend |
|
<?
include "connect.php";
if(!isset($_POST['submit'])){
// form
echo "<h3>Accountinfo opvragen</h3><br />";
echo "<form method='post'>E-mail: <input type='text' name='mail'><br /><input type='submit' name='submit'></form>";
}
else{
if(preg_match("/^([a-z0-9_-]+\.)*[a-z0-9_-]+@([a-z0-9_-]{2,}\.)+([a-z0-9_-]{2,})$/i",$_POST['mail'])){
// e-mail valid
$aResult = mysql_query("SELECT gebruiker, wachtwoord FROM leden WHERE mail = '".$_POST['mail']."'");
if(mysql_num_rows($aResult) > 0){
$aFetch = mysql_fetch_row($aResult);
// bestaat
$bericht = "
Beste ".$aFetch[0].",
Hier is uw gebruikersnaam en wachtwoord
--user: ".$aFetch[0]."
--pass: ".$aFetch[1]."
Mvg,
Creww";
$headers = "From: basdv <basdv.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
mail($_POST['mail'], "AccountInfo", $bericht, $headers);
echo "Succesvol gemaild naar ".$_POST['mail'];
}
else echo "Kon mailadres niet vinden in de DB";
}
else echo "Verkeer mailadres ingevuld, niet geldig.";
}
?>
<? include "connect.php"; if(!isset($_POST['submit'])){ // form echo "<h3>Accountinfo opvragen</h3><br />"; echo "<form method='post'>E-mail: <input type='text' name='mail'><br /><input type='submit' name='submit'></form>"; } else{ if(preg_match("/^([a-z0-9_-]+\.)*[a-z0-9_-]+@([a-z0-9_-]{2,}\.)+([a-z0-9_-]{2,})$/i",$_POST['mail'])){ // e-mail valid $aResult = mysql_query("SELECT gebruiker, wachtwoord FROM leden WHERE mail = '".$_POST['mail']."'"); // bestaat $bericht = " Beste ".$aFetch[0].", Hier is uw gebruikersnaam en wachtwoord --user: ".$aFetch[0]." --pass: ".$aFetch[1]." Mvg, Creww"; $headers = "From: basdv <basdv.com>\r\n"; $headers .= "MIME-Version: 1.0\r\n"; mail($_POST['mail'], "AccountInfo", $bericht, $headers); echo "Succesvol gemaild naar ".$_POST['mail']; } else echo "Kon mailadres niet vinden in de DB"; } else echo "Verkeer mailadres ingevuld, niet geldig."; } ?>
Je bedoeld zoiets? |