页面不会加载时,它是在线PHP

时间:2014-10-05 21:03:32

标签: php mysql

我有一个页面,当它在本地服务器上时完全加载我在服务器上上传了该站点,而我的一些页面不能加载这里是我的页面示例 当它在服务器上时,我应该做些什么吗?在这种情况下常见的问题是什么?

      <?php include("includes/manager_session.php");?>
    <?php require_once("includes/connection.php");?>
    <?php
    $message="";
    if(isset($_POST['submit'])){
    $uname= mysqli_real_escape_string($cnn,$_POST['uname']);
    $pass= mysqli_real_escape_string($cnn,$_POST['pass']);
    $hashed_pass=sha1($pass);
        function redirect_to($location){
            header('Location:'.$location);}
    //checking for available users
    $query="select manager_id,uname,hashed_pass from manager where uname='{$uname}' and    hashed_pass='{$hashed_pass}'";
    $result=mysqli_query($cnn,$query);
    //if query returns a thing
    if($result){
                $num_rows = mysqli_num_rows($result);
                //agar user peida shod
                if($num_rows == 1){


                $found_user=mysqli_fetch_array($result);
                $_SESSION['manager_id']=$found_user['manager_id'];
               $_SESSION['manager_pass']=$found_user['hashed_pass'];

                redirect_to("manager_profile.php");
                }
                //useri peida nashod
                else{
                echo "can not find user";
                redirect_to("manager_login.php");
                }
        }else{echo mysqli_error($cnn);}
        }
      ?>


    <html lang='fa'>
    <head>
      <meta charset="utf-8">
        <title>
            &#1705;&#1740;&#1605;&#1740;&#1575;&#1601;&#1705;&#1585;
        </title>
        <link rel="stylesheet" type="text/css" href="stylesheets/login-form.css" />
    </head>
    <body>

    <div id="wrapper">

<form name="login-form" class="login-form" action="" method="post">

<input type="text" name="uname"/>
<input type="pass" name="pass"/>
</div>
    </body>
    </html>    
    <?php
    mysqli_close($cnn);
    ?>
all pages that has the session part comes up with nothing in it (on of the sessions) when it is online so what is the problem her am i missing something ?

0 个答案:

没有答案