Caphalor
Bekanntes Mitglied
- Dabei seit
- 27.07.2009
- Beiträge
- 481
- Reaktionspunkte
- 0
Hey ho leute hätte mal ne Frage. Ich habe nen kleines Shop-Script, dort muss mann sich bevor man etwas kauft registrieren. Nun folgendes Problem die Mail nach der Registration mit dem Passwort wird nicht versendet.
Hier ist der Code für die Registration, kann mir da jemand helfen ob das hier eventuell falsch ist?
Hier ist der Code für die Registration, kann mir da jemand helfen ob das hier eventuell falsch ist?
PHP:
<?php
include("include/dbconnect.php");
include("include/vars.php");
include("include/baskvars.php");
include("include/header.php");
include("include/left.php");
print ("
<tr><td id='tabrighthead'>Registrierung</td></tr>
<tr><td id='space' height=10> </td></tr>
<tr><td>
<table id='tabiright' align=center border=0 cellpadding=0 cellspacing=0>
<tr><td id='conth0' valign=top>
<table id='content' border=0 cellpadding=0 cellspacing=0>");
if ($action==2) {
include("include/form-register.php");
if ($formular_ok=='1') {
$ts=time();
//passwort erstellen
$regtime=$ts;
$pwges = strlen($regtime); $pwzahl = 7; $pwlen = $pwges - $pwzahl;
$passwort = substr($regtime, $pwlen, $pwges);
$passwort = str_replace (array("0","1","2","3","4","5","6","7","8","9"), array("a","Y","x","M","z","p","B","V","n","j"), $passwort);
//passwort verschluesseln
$encrypt=md5($passwort);
$eintragen = "INSERT INTO `user` (`user_id`, `user_ts`, `user_stat`, `user_firma`, `user_anrede`, `user_vorname`, `user_nachname`, `user_strasse`, `user_hausnr`, `user_land`, `user_plz`, `user_ort`, `user_email`, `user_pass`) VALUES ('', '$ts', '1', '$firma', '$anrede', '$vorname', '$nachname', '$strasse', '$hausnr', '$land', '$plz', '$ort', '$email', '$encrypt')";
$eintrag = mysql_query($eintragen);
//mail an user
$betreff="Ihre Registrierung";
$mailtext="$gruss $nachname,\n\nIhre Registrierung war erfolgreich! Sie können sich jetzt mit den folgenden Zugangsdaten auf unserer Webseite einloggen.\n\nE-Mail: $email\nPasswort: $passwort\n\n$admin_mailfooter";
$mailtext = str_replace(array("ä","ö","ü","Ä","Ö","Ü","ß","&"), array("ä","ö","ü","Ä","Ö","Ü","ß","&"), $mailtext);
mail($email, $betreff, $mailtext, "FROM: $admin_firma <$admin_email>");
//ausgabe
print ("<tr><td>$gruss $nachname,<br><br>Ihre Registrierung war erfolgreich! Sie können sich jetzt mit den Zugangsdaten, die wir Ihnen soeben per E-Mail gesendet haben, hier einloggen.</td></tr>
<tr><td id='space' height=20> </td></tr>
<tr><td>
<table id='tabiright' align=center border=0 cellpadding=0 cellspacing=0>
<tr><td valign=top>
<table id='content' border=0 cellpadding=0 cellspacing=0>
<form action='login.php?session=$session' method='POST'>
<tr><td id='forml'>E-Mail-Adresse:</td><td id='formr'><input type='text' name='email' value='' id='formrtf'></td></tr>
<tr><td id='forml'>Passwort:</td><td id='formr'><input type='password' name='pass' value='' id='formrtf'></td></tr>
<tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td id='forml'> </td><td id='formr'><input type='image' name='submit' value='submit' src='img/bt1.png' border='0' onFocus='if (this.blur) this.blur()'></td></tr>
</form>
</table>
</td></tr>
</table>
</td></tr>
");
}
else {
if ($cpt_ok=='0') { include("include/captcha1.php"); }
else { include("include/captcha2.php"); }
print ("
<tr><td id='formlerr' colspan=2>$fehler</td></tr><tr><td colspan=2> </td></tr>
<form action='register.php?session=$session&csess=$csess&action=2' method='POST'>
<tr><td id='forml'>Firma:</td><td id='formr'><input type='text' name='firma' value='$firma' id='formrtf'></td></tr>
<tr><td id='forml'> </td><td id='formr'><input type='radio' name='anrede' value='Herr'"); if($anrede=='Herr') {print (" checked");} print (">Herr <input type='radio' name='anrede' value='Frau'"); if($anrede=='Frau') {print (" checked");} print (">Frau</td></tr>
<tr><td"); if (empty($_POST['vorname']) || ($vorname=='')) {print (" id='formlerr'");} else {print (" id='forml'");} print (">Vorname:</td><td id='formr'><input type='text' name='vorname' value='$vorname' id='formrtf'></td></tr>
<tr><td"); if (empty($_POST['nachname']) || ($nachname=='')) {print (" id='formlerr'");} else {print (" id='forml'");} print (">Nachname:</td><td id='formr'><input type='text' name='nachname' value='$nachname' id='formrtf'></td></tr>
<tr><td"); if (empty($_POST['strasse']) || ($strasse=='') || empty($_POST['hausnr']) || ($hausnr=='')) {print (" id='formlerr'");} else {print (" id='forml'");} print (">Straße/Nummer:</td><td id='formr'><table id='formr' border=0 cellpadding=0 cellspacing=0><tr><td id='formr1'><input type='text' name='strasse' value='$strasse' id='formrtf1'></td><td id='formr2'><input type='text' name='hausnr' value='$hausnr' id='formrtf2'></td></tr>
</table></td></tr>
<tr><td"); if (empty($_POST['land']) || ($land=='') || empty($_POST['plz']) || ($plz=='') || empty($_POST['ort']) || ($ort=='')) {print (" id='formlerr'");} else {print (" id='forml'");} print (">Land/PLZ/Ort:</td><td id='formr'><table id='formr' border=0 cellpadding=0 cellspacing=0><tr><td id='formr3'><input type='text' name='land' value='$land' id='formrtf3'></td><td id='formr4'><input type='text' name='plz' value='$plz' id='formrtf4'></td><td id='formr5'><input type='text' name='ort' value='$ort' id='formrtf5'></td></tr>
</table></td></tr>
<tr><td"); if (empty($_POST['email']) || ($email=='') || ($mail_ok=='0')) {print (" id='formlerr'");} else {print (" id='forml'");} print (">E-Mail-Adresse:</td><td id='formr'><input type='text' name='email' value='$email' id='formrtf'></td></tr>
<tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td id='forml'>Sicherheitscode:</td><td id='formr'><table id='formr' border=0 cellpadding=0 cellspacing=0>
<tr><td id='space' width=1><img src='img/captcha/cpt1.png' width='1' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg1' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg2' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg3' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg4' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg5' width='30' height='30' border='0'></td>
<td id='space' width=1><img src='img/captcha/cpt1.png' width='1' height='30' border='0'></td><td id='space' width=10> </td>
<td id='cptarr'> </td><td id='space' width=10> </td>
<td id='cptend'>Code wiederholen</td></tr>
</table></td></tr><tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td"); if (empty($_POST['captcha']) || ($cpt_ok==0)) {print (" id='formlerr'");} else {print (" id='forml'");} print (">Code:</td><td id='formr'><input type='text' name='captcha' value='"); if ($cpt_ok=='1') {print ("$cgesamt");} print ("' id='formrtf'></td></tr>
<tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td id='forml'> </td><td id='formr'><input type='image' name='register' value='submit' src='img/bt2.png' border='0' onFocus='if (this.blur) this.blur()'></td></tr>
</form>");
}
}
if ($action==1) {
include("include/captcha1.php");
print ("
<form action='register.php?session=$session&csess=$csess&action=2' method='POST'>
<tr><td id='forml'>Firma:</td><td id='formr'><input type='text' name='firma' value='' id='formrtf'></td></tr>
<tr><td id='forml'> </td><td id='formr'><input type='radio' name='anrede' value='Herr' checked>Herr <input type='radio' name='anrede' value='Frau'>Frau</td></tr>
<tr><td id='forml'>Vorname:</td><td id='formr'><input type='text' name='vorname' value='' id='formrtf'></td></tr>
<tr><td id='forml'>Nachname:</td><td id='formr'><input type='text' name='nachname' value='' id='formrtf'></td></tr>
<tr><td id='forml'>Straße/Nummer:</td><td id='formr'><table id='formr' border=0 cellpadding=0 cellspacing=0><tr><td id='formr1'><input type='text' name='strasse' value='' id='formrtf1'></td><td id='formr2'><input type='text' name='hausnr' value='' id='formrtf2'></td></tr>
</table></td></tr>
<tr><td id='forml'>Land/PLZ/Ort:</td><td id='formr'><table id='formr' border=0 cellpadding=0 cellspacing=0><tr><td id='formr3'><input type='text' name='land' value='' id='formrtf3'></td><td id='formr4'><input type='text' name='plz' value='' id='formrtf4'></td><td id='formr5'><input type='text' name='ort' value='' id='formrtf5'></td></tr>
</table></td></tr>
<tr><td id='forml'>E-Mail-Adresse:</td><td id='formr'><input type='text' name='email' value='' id='formrtf'></td></tr>
<tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td id='forml'>Sicherheitscode:</td><td id='formr'><table id='formr' border=0 cellpadding=0 cellspacing=0>
<tr><td id='space' width=1><img src='img/captcha/cpt1.png' width='1' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg1' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg2' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg3' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg4' width='30' height='30' border='0'></td>
<td id='cpt'><img src='$cptimg5' width='30' height='30' border='0'></td>
<td id='space' width=1><img src='img/captcha/cpt1.png' width='1' height='30' border='0'></td><td id='space' width=10> </td>
<td id='cptarr'> </td><td id='space' width=10> </td>
<td id='cptend'>Code wiederholen</td></tr>
</table></td></tr>
<tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td id='forml'>Code:</td><td id='formr'><input type='text' name='captcha' value='' id='formrtf'></td></tr>
<tr><td colspan=2 id='space' height=4> </td></tr>
<tr><td id='forml'> </td><td id='formr'><input type='image' name='register' value='submit' src='img/bt2.png' border='0' onFocus='if (this.blur) this.blur()'></td></tr>
</form>
");
}
print ("</table>
</td></tr>
</table>
</td></tr>
<tr><td id='space' height=10> </td></tr>
");
include("include/footer.php");
mysql_close($verbindung);
?>