@ 2014-06-03T15:13:42Z <?php
function random_password( $length = 8 ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
$password = substr( str_shuffle( $chars ), 0, $length );
return $password;
}
$error = "";
if (isset($_GET["token"]) && preg_match('/^[0-9A-F]{40}$/i', $_GET["token"])) {
$token = $_GET["token"];
define("DB_HOST","mysql117.loopia.se");
define("DB_USER","normal@i103189");
define("DB_PASS","KungMicke87");
define("DB_NAME","indiehjaerta_com");
// Connect to MySQLi
$sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli));
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$query = mysqli_query($sqli, "SELECT * FROM passwordrequest WHERE token='$token'") or die("Error: ".mysqli_error($sqli));
$results = mysqli_num_rows($query);
if ($results == 0)
{
$error = "Error invalid token."
}
else
{
$row = mysqli_fetch_array($query);
$email = $row['email'];
$timestamp = $row['timestamp'];
$url = "http://www.indihjaerta.com/login.php";
//Generate Password Here -- FIXA!!!!!!!!!
$password = random_password(8);
echo $password;
//Has Password Here
$hashedpassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);
//Update new password in table
$updatequery = mysqli_query($sqli,"UPDATE members SET password = '$hashedpassword' WHERE email='$email'");
//$message = "Press think link $url to reset your password.\n\n If you didn't request a password change please discard this e-mail.";
$message = "This function is currently not working :(. But it should be a password here."
$headers = 'From: [indiehjaerta.com] Admin <no-reply@indiehjaerta.com>' . "\r\n";
mail($email, "[indiehjaerta.com] New Password", $message, $headers);
//Delete post to make link invalid
$deletequery = mysqli_query($sqli, "DELETE * FROM passwordrequest WHERE token='$token' AND email='$email' AND timestamp='$timestamp'") or die("Error: ".mysqli_error($sqli));
}
}
else
{
$error = "No token."
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>indiehjaerta.com</title>
<link href="style_test.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a href="login.php">Login<a/> -
<a href="admin.php">Admin<a/> -
<a href="members.php">Members<a/> -
<a href="register.php">Register<a/> -
<a href="blog.php">Blog<a/> -
<a href="news.php">News<a/> -
<a href="event.php">Event<a/> -
<a href="forum.php">Forum<a/>
<br /> <br />
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<?php
if (!empty($error))
{
?>
<td colspan="3"><strong><?php echo $error ?></strong></td>
<?php
}
else
{
?>
<td colspan="3"><strong>Not implemented. <!-- An e-mail containing your new password has been sent to e-mail . --></strong></td>
<?php
}
?>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.29 0.011 0.067 12.52 5.4.28 0.008 0.053 12.41 5.4.27 0.007 0.043 12.41 5.4.26 0.010 0.048 12.41 5.4.25 0.006 0.052 12.41 5.4.24 0.009 0.045 12.41 5.4.23 0.007 0.038 12.40 5.4.22 0.006 0.039 12.40 5.4.21 0.008 0.036 12.40 5.4.20 0.008 0.054 12.40 5.4.19 0.007 0.044 12.40 5.4.18 0.011 0.034 12.39 5.4.17 0.008 0.038 12.40 5.4.16 0.012 0.062 12.39 5.4.15 0.009 0.040 12.39 5.4.14 0.008 0.038 12.09 5.4.13 0.007 0.037 12.06 5.4.12 0.008 0.036 12.03 5.4.11 0.011 0.034 12.02 5.4.10 0.008 0.038 12.03 5.4.9 0.009 0.050 12.03 5.4.8 0.011 0.032 12.02 5.4.7 0.004 0.037 12.02 5.4.6 0.005 0.036 12.02 5.4.5 0.007 0.059 12.02 5.4.4 0.007 0.038 12.01 5.4.3 0.005 0.040 12.01 5.4.2 0.007 0.041 12.00 5.4.1 0.010 0.071 12.01 5.4.0 0.013 0.062 11.50 5.3.28 0.011 0.049 12.71 5.3.27 0.010 0.050 12.73 5.3.26 0.009 0.059 12.72 5.3.25 0.009 0.046 12.71 5.3.24 0.007 0.038 12.72 5.3.23 0.005 0.040 12.71 5.3.22 0.007 0.038 12.68 5.3.21 0.009 0.045 12.68 5.3.20 0.005 0.039 12.68 5.3.19 0.004 0.048 12.68 5.3.18 0.006 0.043 12.67 5.3.17 0.007 0.041 12.67 5.3.16 0.015 0.050 12.67 5.3.15 0.007 0.046 12.68 5.3.14 0.004 0.039 12.66 5.3.13 0.008 0.042 12.66 5.3.12 0.007 0.042 12.66 5.3.11 0.007 0.052 12.66 5.3.10 0.005 0.054 12.14 5.3.9 0.009 0.048 12.13 5.3.8 0.008 0.036 12.11 5.3.7 0.004 0.041 12.11 5.3.6 0.010 0.039 12.09 5.3.5 0.004 0.041 12.04 5.3.4 0.007 0.037 12.04 5.3.3 0.006 0.036 12.00 5.3.2 0.005 0.043 11.78 5.3.1 0.012 0.039 11.74 5.3.0 0.007 0.035 11.73
preferences:dark mode live preview
163.75 ms | 1394 KiB | 7 Q