@ 2014-06-03T15:16:26Z <?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.006 0.042 12.52 5.4.28 0.012 0.061 12.41 5.4.27 0.009 0.037 12.41 5.4.26 0.003 0.042 12.42 5.4.25 0.009 0.035 12.42 5.4.24 0.008 0.035 12.42 5.4.23 0.005 0.040 12.41 5.4.22 0.007 0.037 12.41 5.4.21 0.011 0.049 12.41 5.4.20 0.006 0.053 12.41 5.4.19 0.010 0.050 12.40 5.4.18 0.007 0.054 12.41 5.4.17 0.010 0.052 12.41 5.4.16 0.011 0.046 12.40 5.4.15 0.007 0.049 12.40 5.4.14 0.011 0.050 12.09 5.4.13 0.007 0.048 12.07 5.4.12 0.010 0.045 12.04 5.4.11 0.010 0.046 12.04 5.4.10 0.008 0.037 12.03 5.4.9 0.011 0.035 12.04 5.4.8 0.007 0.037 12.03 5.4.7 0.008 0.037 12.03 5.4.6 0.009 0.046 12.03 5.4.5 0.008 0.037 12.03 5.4.4 0.008 0.037 12.02 5.4.3 0.005 0.050 12.02 5.4.2 0.006 0.039 12.02 5.4.1 0.006 0.040 12.01 5.4.0 0.007 0.038 11.50 5.3.28 0.006 0.042 12.70 5.3.27 0.007 0.044 12.72 5.3.26 0.008 0.041 12.72 5.3.25 0.006 0.043 12.72 5.3.24 0.016 0.043 12.72 5.3.23 0.013 0.047 12.71 5.3.22 0.010 0.048 12.68 5.3.21 0.013 0.046 12.68 5.3.20 0.011 0.047 12.68 5.3.19 0.009 0.049 12.68 5.3.18 0.005 0.051 12.67 5.3.17 0.013 0.033 12.67 5.3.16 0.005 0.039 12.67 5.3.15 0.010 0.048 12.67 5.3.14 0.006 0.049 12.66 5.3.13 0.010 0.051 12.66 5.3.12 0.005 0.061 12.66 5.3.11 0.009 0.055 12.66 5.3.10 0.012 0.060 12.14 5.3.9 0.010 0.054 12.12 5.3.8 0.008 0.041 12.11 5.3.7 0.005 0.041 12.11 5.3.6 0.005 0.042 12.09 5.3.5 0.005 0.040 12.04 5.3.4 0.010 0.035 12.04 5.3.3 0.004 0.039 12.00 5.3.2 0.006 0.041 11.79 5.3.1 0.012 0.044 11.75 5.3.0 0.010 0.046 11.73
preferences:dark mode live preview
137.55 ms | 1394 KiB | 7 Q