• (3 Pages)
  • +
  • 1
  • 2
  • 3

Text Based Mafia Game || Register and Forgot pass Part 2. Creating the Register and Forgot pass on our Text Based Game Rate Topic: -----

#31 Denis1  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 32
  • View blog
  • Posts: 103
  • Joined: 29-July 09

Posted 06 June 2014 - 01:48 PM

View Postdongangsters, on 05 May 2014 - 11:01 AM, said:

Fatal error: Cannot redeclare checkemail() (previously declared in /home/a8699312/public_html/functions.php:13) in /home/a8699312/public_html/functions.php on line 16


need help please


Can you please post your code
Was This Post Helpful? 0
  • +
  • -

#32 LennyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-June 14

Posted 23 June 2014 - 11:02 AM

Hi

Thanks for the great tutorial....just struggling a bit with the lost_pass.php and i am getting the following error



Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'cloudnf'@'localhost' (using password: NO) in /home/cloudnf/public_html/lost_pass.php on line 17

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/cloudnf/public_html/lost_pass.php on line 17

Warning: mysql_query() [function.mysql-query]: Access denied for user 'cloudnf'@'localhost' (using password: NO) in /home/cloudnf/public_html/lost_pass.php on line 18

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/cloudnf/public_html/lost_pass.php on line 18
Access denied for user 'cloudnf'@'localhost' (using password: NO)


Registering and the test.php works fine and adds the information to the database.
Any help would be greatly appreciated
Was This Post Helpful? 0
  • +
  • -

#33 LennyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-June 14

Posted 23 June 2014 - 11:09 AM

This is my code for lost_pass.php
<? 
if (isset($_POST['Register'])) {

$password = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6);
		// Generate a random password
}
		

?>

<? 
if (isset($_POST['Send'])) {

$password = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6);
		// Generate a random password

$nsql = "SELECT * FROM users WHERE mail='".mysql_real_escape_string($_POST['Email'])."'";
$query = mysql_query($nsql) or die(mysql_error());
$row = mysql_fetch_object($query);
$name = htmlspecialchars($row->name);
$pass = htmlspecialchars($row->password);
$mail = htmlspecialchars($row->mail);

	
	
if((empty($_POST['Email']))){ // if the email field is empty there will be an error

		echo 'You one field empty.';
	}else{
		
	
	  if(empty($name)){ // if there is no name with the entered email
		echo 'Invalid information.';
	}else{
	
	  if($_POST['Email'] != $mail){
			echo 'Invalid information.'; // if their is no match in the email
	}else{
	
	if(!checkEmail($_POST['Email'])){ // the checkEmail function we have in our function that saves us time and sapce
		echo 'Your email is not valid!';
	}else{
		
	$result = mysql_query("UPDATE users SET password='$password' WHERE name='" .mysql_real_escape_string($name). "'") 
or die(mysql_error());	

			$to = $_POST['Email'];
    $from = "no-reply@Game.co.uk";
    $subject = "Registration - Your Registration Details";

    $message = "<html>
   <body background=\"#4B4B4B\">
   <h1>Game Registration Details</h1>
   Dear $name, <br>
    <center>
Your Username: $name <p>

Your Password: $password <p>

  </body>
</html>";
   
    $headers  = "From: Game Lost Details <no-reply@Game.co.uk>\r\n";
    $headers .= "Content-type: text/html\r\n";

	mail($to, $subject, $message, $headers);             

			echo 'We sent you an email with your Details!';
		
	}
}
}// check if name is unused.
}// check if accepted to the tos.
}// name check.
// if post register.		

?>

<form method="post" >
  <center>
    <h1><strong>Lost Password</strong></h1>
    <p>Email: 
      <input type="text" name="Email" id="Email">
      <br>
<input type="submit" name="Send" id="Send" value="Send">
    </p>
</center>
</form>


Was This Post Helpful? 0
  • +
  • -

#34 Mihaiboss  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-November 14

Posted 22 November 2014 - 05:23 AM

Table 'u142563274_ml.login' doesn't exist with i want to reset password ...

wtf?
Was This Post Helpful? 0
  • +
  • -

#35 NakashimaKun  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-December 14

Posted 12 December 2014 - 07:27 AM

Hey guys, I noticed something with the lost password script it wasn't outputting the password to the database into md5. I worked out a fix but I aint tested it yet once I've tested I'll share code :)
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3