Jump to content
php.lv forumi

help


Solitary

Recommended Posts

parliku uz sava dator web serveri kas nebija ilgi lietots , uz provaidera viss ie ka nakas bet man uz sava pc met kludas saistiba ar MAIL

 

 

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in d:\webserver\www\forgot_password.php on line 27

 

 

<?php
require_once('db.php');
include('functions.php');
include('settings.php');

if ( array_key_exists ( '_submit_check', $_POST ) )
{
	if($_POST['email']!='' && valid_email($_POST['email'])==TRUE)
	{

		$getUser = mysql_query('SELECT ID, Username, Temp_pass, Email FROM users WHERE Email = "'.mysql_real_escape_string($_POST['email']).'"');
		if(mysql_num_rows($getUser)==1)
		{

			$temp_pass = random_string('alnum', 12);
			$row = mysql_fetch_assoc($getUser);

			$query = mysql_query("UPDATE users SET Temp_pass='".$temp_pass."', Temp_pass_active=1 WHERE `Email`='".mysql_real_escape_string($row['Email'])."'");	

			$headers = 	'From: [email protected]' . "\r\n" .
						'Reply-To: [email protected]' . "\r\n" .
						'X-Mailer: PHP/' . phpversion();
			$subject = "Password Reset Request";
			$message = "Dear ".$row['Username'].", Someone (presumably you), has requested a password reset. We have generated a new password for you to access our website:  $temp_pass . To confirm this change and activate your new password please follow this link to our website: ".$url."confirm_password.php?ID=".$row['ID']."&new=".$temp_pass.". Don't forget to update your profile as well after confirming this change and create a new password. If you did not initiate this request, simply disregard this email, and we're sorry for bothering you.";


			if(mail($row['Email'], $subject, $message, $headers))
			{
				$msg = 'Password reset request sent. Please check your email for instructions.';
			}
			else {
				$error = 'Failed sending email';
			}
		}
		else {
			$error = 'There is no member to match your email.';
		}
	}
	else {
		$error = 'Invalid email !';
	}
}
?>

Neizprotu kur vaina , lietoju appserv-win32-2.4.4a un mekleju php.ini failu vispar nekur neatradu es neko no tam lietam daudz nesaprotu vai varetu palidzet

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...