I can' find solution how to get it working. I upgraded Mysql 4 to Mysql 5 and changed PHP to 5.2, since than i can't activate account and login. What's wrong with this code?
include_once("conn.php");
$check_num = $_GET['c'];
$exists ="SELECT * FROM registry WHERE check = '$check_num'";
$eresult = mysql_query($exists);
if (!$eresult)
{
die('<p>Error performing query: ' . mysql_error() . '</p>');
}
$row = mysql_fetch_array($eresult);
$key = $row['regkey'];
$name = $row['title'] . ' ' . $row['name'] . ' ' . $row['surname'];
$user = $row['username'];
if (mysql_num_rows($eresult) == 1)
{
$selected = mysql_query($eresult);
$sql = " UPDATE registry
SET check = 'ok'
WHERE regkey = $key";
$result = mysql_query($sql);
if (mysql_affected_rows() == 1)
{
$message = "The account $user has now been activated.";
echo "<script type=\"text/javascript\">
alert('The account $user has now been activated.');
</script>
<script>document.location.href='../index.php'</script>";
}
}
else
{
$message = "There was a problem with your check value, please try copy and pasteing the URL again. ";
}
echo $message;
?>
Please add
at the beginning of your code and tell us, what errors do appear.
With this additional information, we might provide more help.
Additional hint: In case you didn't only update PHP/mySQL, but e.g. XAMPP, have a look in the new
php.ini
file. You probably need to change some settings.