-1

请我的注册和激活链接到现在为止都可以正常工作,当单击激活帐户的链接时,它会显示“连接问题”。

这是注册文件的相关代码

{
       //generate random code
       $code = rand(11111111,99999999);

       //send activation email
       $to = $email;
       $subject = "Activate your account";
       $headers = "From: donotreply@reacheasy.co.uk";
       $body = " Hello $fullname,\n\nUsername $username,\n\n Password $password ,\n\nYou registered and need to activate your account, n\nPlease keep this email safe as it contains your password . Click the link below or paste it into the URL bar of your browser\n\nhttp://reacheasy.co.uk/activate.php?code=$code\n\nThanks!"; 

这是激活文件

<?php
 include 'include/global.php';

    $code = $_GET['code'];

    if (!$code)
        echo "No code supplied";
    else
    {
        $check = mysql_query("SELECT * FROM reusers WHERE code='$code' AND active='1'");
        //echo "SELECT * FROM users WHERE code='$code' AND active='1'";
        if (mysql_num_rows($check)==1)
            echo "You have already activated your account";
        else
        {
            $activate = mysql_query("UPDATE reusers SET active='1' WHERE code='$code'");
            echo "Your account has been activated!<a href='index.php'>Return to login page</a>";
        }

    }
    ?> 

请帮忙看看谢谢

4

1 回答 1

0

检查 global.php 并确保您可以连接。or mysql_error() 在结束时调用mysql_connect()

于 2012-07-08T12:38:18.613 回答