Nieuw lid |
|
ik heb een probleem met mijn script op lijn 27 en krijg het niet werkende kunnen julie helpen
dit is het script
<?php
include_once("connect.php");
require 'functions.php';
?>
<?
if (isset($_POST['Send'])) {
$password = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6);
// Generate a random password
$nsql = "SELECT * FROM login 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->pass);
$mail = htmlspecialchars($row->email);
if((empty($_POST['Email']))){
echo 'You one field empty.';
}else{
if(empty($name)){ if
echo 'Invalid information.';
}else{
if($_POST['Email'] != $mail){
echo 'Invalid information.';
}else{
if(!checkEmail($_POST['Email'])){
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@subnet.site11.com";
$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@subnet.site11.com>\r\n";
$headers .= "Content-type: text/html\r\n";
mail($to, $subject, $message, $headers);
echo 'We sent you an email with your Details!';
}
}
}
}
}
?>
<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>
<?php include_once("connect.php"); require 'functions.php'; ?> <? if (isset($_POST['Send'])) { // Generate a random password if((empty($_POST['Email']))){ echo 'You one field empty.'; }else{ echo 'Invalid information.'; }else{ if($_POST['Email'] != $mail){ echo 'Invalid information.'; }else{ if(!checkEmail($_POST['Email'])){ echo 'Your email is not valid!'; }else{ $to = $_POST['Email']; $from = "no-reply@subnet.site11.com"; $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@subnet.site11.com>\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); echo 'We sent you an email with your Details!'; } } } } } ?> <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>
alvast bedankt
|