SA-MP Forums Archive
mysql ucp - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql ucp (/showthread.php?tid=570701)



mysql ucp (EDITED) - ilepopivanov - 12.04.2015

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


Re: mysql ucp - BleverCastard - 12.04.2015

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.


Re: mysql ucp - ilepopivanov - 12.04.2015

Can u give me tutorial how to setup on localhost


Re: mysql ucp - zT KiNgKoNg - 12.04.2015

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?


Re: mysql ucp - ilepopivanov - 12.04.2015

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