Hi i manage to make some error sow that the skript ignores to send email..
i have no ide what i have made wrong or how to fix it do not know what i have missed!
see at the mail statment!
<?php
$username = $_POST["username"];
$set = $_POST["set"];
function emailsyntax_is_valid($email) {
$to_work_out = explode("@", $email);
if (!isset($to_work_out[0])) return FALSE;
if (!isset($to_work_out[1])) return FALSE;
$pattern_local = '^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?).([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$';
$pattern_domain = '^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?).([-]?)[0-9a-z]*([-]?[0-9a-z]+)+)*.[a-z]{2,4}$';
$match_local = eregi($pattern_local, $to_work_out[0]);
$match_domain = eregi($pattern_domain, $to_work_out[1]);
if ($match_local && $match_domain) {
return TRUE;
}
return FALSE;
}
if ($set=="set") {
$username_control = 1;
$username2_control = 1;
$username3_control = 1;
$main_control = 1;
$main_control2 = 0;
if($username == ""){
$empty_username = "Ooops! - You forgot to enter your username.";
$username_control = 0;
$main_control = 0;
}
elseif(strlen($username) < 4){
$empty_username = "Ooops! - Your username should be at least 4 letters long.";
$username2_control = 0;
$main_control = 0;
}
elseif(strlen($username) > 20){
$empty_username = "Ooops! - Your username can't be larger than 20 letters.";
$username3_control = 0;
$main_control = 0;
}
elseif($main_control == 1){
$str = $username;
$str = strtolower($str);
require ('./management/mysqlcondbrr.php');
$result1 = mysql_query("SELECT username FROM reg_info where username='$str' LIMIT 1", $starta);
if (mysql_num_rows($result1)==0)
$empty_username = "Ooops! - The nickname you chose don't exists!";
$main_control2 = 1;
mysql_close($starta);
}
}
if($main_control2 != 1 && $main_control == 1) {
$result2 = mysql_query("SELECT * FROM reg_info WHERE username='$str'", $starta);
if (mysql_num_rows($result2) == '1') {
while ($row = mysql_fetch_array($result2)) {
$message = "Your Register Password Is ".$row['password']."";
$email = $row['email'];
$mail = mail($email, "Your Registerd Password", $message,"From: [email]administrator@flameline.com[/email]\r\n");
if ($sent_email) {
$sent_email = "E-mail sent! - To your registerd e-mail!";
}
}
}else{
$sent_emailerror = "E-mail send error! - Try again or invalid e-mail!";
}
}
?>
<?PHP
function info() {
print "Please enter your usernamen in the blank field <br>
below to recive your password.<br>
Then press get password button to recive your<br>
password.<br>";
}function validuser() {
print "Thanks in some seconds you will recive a email <br>
with your password in it.<br>
If you get an error please read the error note <br>";
}
?>
<?php
if (!$username_control || !$username2_control || !$username3_control || !$main_control2) {
info();
}else{
validuser();
}
?>
<br>
<form action="<?=$PHP_SELF?>" method="post" name="hej">
<b>Your Username Here:<br><br></b>
<input type="text" name="username" size="15" class="inputSidebar" val="<?php
if($username_control != 0){ echo $_POST['username'];}
elseif(username2_control !=0){ echo $_POST['username'];}
elseif(username3_control !=0){ echo $_POST['username'];}
elseif(main_control2 != 0){ echo $_POST['username'];}
else{ echo ''; } ?>">
<?php echo $empty_username; ?>    
<input class="button" type="submit" name="submit" value="Get password">
<?php echo $_POST['username']; ?>
<input type="hidden" name="set" value="set">
</form>