Jump to content

Activate.php


Smee

Recommended Posts

I am getting the following error:

 

Parse error: syntax error, unexpected '{' in /home/footba33/public_html/activate.php  on line 25

 

Line 25 is this:

 

if ( ($x > 0) && (strlen($y) == (32)) {

 

 

in the following activate.php, i have checked it several times and can't see a reason for it not to work?

 

Any help would be good. Thanks!

 

<?php

// This page activates a user account

require_once ('./includes/config.inc.php');

$page_title = 'Activate Your Account';

include ('./includes/header.html');

if (isset($_GET['x'])) {
$x = (int) $_GET['x'];
} else {
$x = 0;
}

if (isset($_GET['y'])) {
$y = $_GET['y'];
} else {
$y = 0;
}

// If $x and $y are not correct re-direct user.

if ( ($x > 0) && (strlen($y) == (32)) {

require_once ('../mysql_connect.php');

$query = "UPDATE users SET active=NULL WHERE (user_id=$x AND active='" .
escape_data($y) . "') LIMIT 1";

$result = mysql_query ($query) or trigger_error("Query: $query\n <br />MySQL Error: " . 
mysql_error());

// Print a customized message

if (mysql_affected_rows() == 1) {
echo "<h1>Your account has now been activated. You can now log in.</h1>";
} else {
echo '<p><font color="red" size="+1">Your account could not be activated. Please re-check the link or contact the system administrator.</font></p>';
}

mysql_close();

} else {  // Redirect

$url = 'http://' . $_SERVER['HTTP_HOST']
. dirname($_SERVER['PHP_SELF']);

// Check for trailing slash

if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {

	$url = substr ($url, 0, -1); // Chop of the slash

	}
// Add the page

$url .= '/index.php';

ob_end_clean(); // Delete the buffer
header("Location: $url");
exit(); // Quit the script

}

include ('./includes/footer.html');


?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.