@ 2014-06-03T15:14:27Z <?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.6.10 0.000 0.043 21.03 5.6.9 0.010 0.083 21.05 5.6.8 0.020 0.053 20.56 5.5.26 0.017 0.070 20.78 5.5.25 0.010 0.073 20.68 5.5.24 0.007 0.077 20.27 5.4.43 0.020 0.057 19.63 5.4.42 0.013 0.080 19.52 5.4.41 0.027 0.053 19.32 5.4.40 0.020 0.037 19.13 5.4.39 0.020 0.070 18.84 5.4.38 0.013 0.057 19.06 5.4.37 0.023 0.040 19.11 5.4.36 0.030 0.040 19.24 5.4.35 0.017 0.083 19.21 5.4.34 0.017 0.057 19.13 5.4.32 0.020 0.067 19.00 5.4.31 0.027 0.067 18.98 5.4.30 0.037 0.037 19.12 5.4.29 0.030 0.060 19.05 5.4.28 0.020 0.050 19.08 5.4.27 0.020 0.083 18.92 5.4.26 0.023 0.073 19.20 5.4.25 0.023 0.033 19.16 5.4.24 0.013 0.050 19.07 5.4.23 0.023 0.047 19.04 5.4.22 0.023 0.060 18.94 5.4.21 0.020 0.040 18.97 5.4.20 0.017 0.047 19.20 5.4.19 0.020 0.083 18.83 5.4.18 0.027 0.043 19.13 5.4.17 0.023 0.043 19.12 5.4.16 0.020 0.047 18.96 5.4.15 0.027 0.043 18.93 5.4.14 0.020 0.077 16.38 5.4.13 0.037 0.027 16.39 5.4.12 0.030 0.047 16.33 5.4.11 0.027 0.073 16.46 5.4.10 0.023 0.070 16.27 5.4.9 0.020 0.070 16.46 5.4.8 0.020 0.040 16.55 5.4.7 0.023 0.067 16.50 5.4.6 0.017 0.070 16.47 5.4.5 0.030 0.053 16.33 5.4.4 0.027 0.067 16.54 5.4.3 0.027 0.060 16.24 5.4.2 0.023 0.043 16.43 5.4.1 0.037 0.030 16.27 5.4.0 0.017 0.047 15.80 5.3.29 0.023 0.073 14.61 5.3.28 0.027 0.070 14.49 5.3.27 0.037 0.060 14.60 5.3.26 0.033 0.057 14.74 5.3.25 0.030 0.067 14.53 5.3.24 0.020 0.073 14.55 5.3.23 0.023 0.067 14.63 5.3.22 0.027 0.070 14.61 5.3.21 0.017 0.050 14.67 5.3.20 0.023 0.040 14.59 5.3.19 0.030 0.063 14.50 5.3.18 0.023 0.033 14.70 5.3.17 0.033 0.060 14.55 5.3.16 0.023 0.050 14.66 5.3.15 0.033 0.040 14.59 5.3.14 0.027 0.057 14.59 5.3.13 0.030 0.057 14.49 5.3.12 0.020 0.040 14.62 5.3.11 0.023 0.053 14.49 5.3.10 0.020 0.043 14.49 5.3.9 0.020 0.070 14.49 5.3.8 0.027 0.053 14.49 5.3.7 0.027 0.047 14.49 5.3.6 0.023 0.063 14.49 5.3.5 0.023 0.057 14.49 5.3.4 0.037 0.057 14.49 5.3.3 0.020 0.070 14.49 5.3.2 0.027 0.060 14.49 5.3.1 0.017 0.077 14.49 5.3.0 0.023 0.043 14.49
preferences:dark mode live preview
141.4 ms | 1386 KiB | 7 Q