mysql ucp
#1

I made password recover function in my ucp but I don't know how to setup Mail()

I made this for test but not working

Код:
if($submit)
{
    if($Username && $Email)
    {
        $query = mysql_query("SELECT * FROM `players` WHERE `Username` = '$Username' AND `Email` = '$Email'");
        if(mysql_num_rows($query) == 1) 
        {
            while($row = mysql_fetch_assoc($query)) 
            {
                $dbUsername = $row['Username']; 
                $dbEmail = $row['Email']; 
            }
            if($Username == $dbUsername && $Email == $dbEmail) 
			{
				$message = "Vasata lozinka e";//Your pssword is
				mail($Email, 'MicroGaming NoReply', $message);
				header('Location: index.php');
            }
			else echo "<script>alert('Морате да внесете Е-Маил!');</script>";// You must enter E-Mail
        }
    }
}
When I enter incorrect email or username it not redirect me but when I enter all correct it redirect me into index.php but mail not send

anyone? sorry for my bed english

EDIT: I fixed that my line is
PHP код:
mail($Email,'MicroGaming Community','Hello mr.'$Username,'From: admin@mg-game.info'); 
When I go on localhost/UCP v1/lozinka.php I get this: http://prntscr.com/6sxisg
Reply
#2

You can't use Mail() function on localhost, if it's not set up. Also, if it's on a host(website) you need to see if they allow it also.
Reply
#3

Can u give me tutorial how to setup on localhost
Reply
#4

This is the wrong section to be honest for this type of code, "SA-MP" -> "Scripting & Plugins" -> "Script Help" But if you use this awesome search engine called "******" you might-be-able to find it on your own?
Reply
#5

Edited! See ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)