显示此网页的网页有一个重定向循环

时间:2014-02-25 08:48:44

标签: php

每当我打开此页面时,都会显示此网页有重定向循环。有人可以建议我代码有什么问题吗?

<?php
    //Start session
    session_start();
    unset($_SESSION['views']);
    $i = $_GET['id'];
    $_SESSION['views'] = $i;
    echo "Session Value is ".$_SESSION['views'];
    $tbl_name = "mgen_validation_check";
    mysql_connect("localhost", "root", "") or die(mysql_error()); 
    mysql_select_db("mgen") or die(mysql_error()); 
    $sql = "SELECT * FROM $tbl_name WHERE md5values='$i'";
    $result = mysql_query($sql);

    $count = mysql_num_rows($result);

    if ($count == 0) {
        header("location:popup.php");
    }
    else {
        header("location:login.php?id=".$_SESSION['views']);

        //Unset the variables stored in session
        unset($_SESSION['SESS_FIRST_NAME']);
        unset($_SESSION['SESS_LAST_NAME']);
        $_SESSION['code'] = "mgen";
    } 
?>

0 个答案:

没有答案