<?php # Script 16.7 - activate.php
// This page activates the user's account.
require_once ('includes/config.inc.php');
$page_title = 'Activate Your Account';
include ('includes/header.html');
// Validate $_GET['x'] and $_GET['y']:
$x = $y = FALSE;
if (isset($_GET['x']) && preg_match ('/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,6}$/', $_GET['x']) ) {
$x = $_GET['x'];
}
if (isset($_GET['y']) && (strlen($_GET['y']) == 32 ) ) {
$y = $_GET['y'];
}
// If $x and $y aren't correct, redirect the user.
if ($x && $y) {
// Update the database...
require_once (MYSQL);
$q = "UPDATE users SET active=NULL, trunck=1 WHERE (email='" . mysqli_real_escape_string($dbc, $x) . "' AND active='" . mysqli_real_escape_string($dbc, $y) . "') LIMIT 1";
$r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc));
// Print a customized message:
if (mysqli_affected_rows($dbc) == 1) {
echo "<h3>Your account is now active. You may now log in.</h3>";
?>
} else {
echo '<p class="error">Your account could not be activated. Please re-check the link or contact the system administrator.</font></p>';
}
mysqli_close($dbc);
} else { // Redirect.
$url = BASE_URL . 'index.php'; // Define the URL:
ob_end_clean(); // Delete the buffer.
header("Location: $url");
exit(); // Quit the script.
} // End of main IF-ELSE.
include ('includes/footer.html');
?>
this is a code which i goggled and got i am a beginner but this code is giving error
Parse error: parse error in ...\login\activate.php on line 46
kindly help me !! ty in advance !! and please explain me the error.. ty!!