简体   繁体   English

php文件在本地服务器上工作,但在联机服务器上失败

[英]php file is working on local server but fails when on online server

I did complete a website for online Entrance form for students as my demo project to learn. 我确实完成了一个用于学生在线入学申请表的网站,作为我要学习的演示项目。 When I run from my local server it works fine but when I uploaded on webserver and tasted index.php and other files run fine except when user enter his/her symbol no to check if he/she already been registered or not..I have coded a logic 当我从本地服务器运行时,它可以正常工作,但是当我在网络服务器上上传并品尝到index.php和其他文件时,除了用户输入他/她的符号no来检查他/她是否已经注册外,其他文件都运行正常。编码逻辑

if (exists)>Show admit card if(don't exist)>show alert box 如果(存在)>显示入场卡,如果(不存在)>显示警报框

It works fine in local server but in webserver when I enter value in search box and enter then it shows empty page with no any error. 当我在搜索框中输入值并输入然后显示空白页时,它在本地服务器上运行良好,但在Web服务器中运行,没有任何错误。

I have one row in my database. 我的数据库中有一行。 So in case you wanna check here is the symbol no in column =15369-2017-02 . 因此,如果您想在此处检查= 15369-2017-02列中的符号no。 On Entering submit it should show admit card and you can enter any random value other then this .which should show alert box. 在输入提交时,它应该显示准入卡,您可以输入除此以外的任何随机值,它应该显示警报框。

Here is my website 这是我的网站

https://cmprc.edu.np/condensed/entrance_form_demo/studntreport/main/ https://cmprc.edu.np/condensed/entrance_form_demo/studntreport/main/

This is the code of file which is not responding and showing blank 这是没有响应并显示空白的文件代码

    <html>
    <head>
    <title>
CDP || Admission Form
    </title>

     <link href="css/bootstrap.css" rel="stylesheet">
    <link href="../style.css" media="screen" rel="stylesheet" type="text/css" />


    <body style="background-color: white;">






   <?php
      include('../connect.php');
    $var_value = $_POST['search_value'];
    echo $var_value;

    $sql="SELECT * FROM entrance WHERE re_value='$var_value'";
    $STH = $db->prepare($sql);
    $STH->execute(array($var_value));
    $User = $STH->fetch();

    if (empty($User))

      echo "<script>alert('Sorry, you Have not Registered yet');
            window.location = 'index.php';</script>"; 
    else
            $result = $db->prepare("SELECT *  FROM entrance
                                    WHERE re_value = '$var_value' ORDER BY id ASC;");
            $result->execute();
            for($i=0; $row = $result->fetch(); ){

          ?>


    <link href="../style.css" media="screen" rel="stylesheet" type="text/css" />
    <center><h4><i class="icon-edit icon-large"></i> You've Already Registered</h4></center>
    <hr>




    <center>

      <div class="panel panel-default">
    <div class="container">
      <div class="row">
        <div class="col-md-4 seventy">
           <img src="img/admit.png"/ >

        </div>

        <div class="col-md-8 thirty">

      <img src="../image/profile/<?php echo $row['pic_value'];?>" class="roundimage2"   alt=""/>
    </div>
      </div>
    </div>


    <hr>
    <table style=" width: 500px;">

      <tr>
    <td >Roll no: </td>
    <td> <?php echo $row['id']; ?></td>
      </tr>

    <tr>
    <td >Name : </td>
    <td > <?php echo $row['name_en_value']; ?></td>


    <td > Subject:  </td>
    <td > <?php echo $row['ge_value']; ?> </td>
     </tr>
    </table>

    <br><br>
    <h5><i><strong>STUDENTS MUST BRING THIS ADMIT CARD ON THE DAY OF EXAMINATION</strong></i></h5>

    <br>
  </div>
  </center>


    <?php
    }
    ?>

    </body>
    <?php include('footer.php');?>

    </html>

Any help? 有什么帮助吗? I did almost finished it which I was working continously for 4-5 Days. 我几乎完成了我连续工作4-5天的工作。

It seems that your php is not executed correctly. 看来您的php执行不正确。 Maybe try to enable error reporting to get a hint of what's wrong. 也许尝试启用错误报告以获取错误提示。

Include the following at the beginning of your destination file (my.php) 在目标文件(my.php)的开头包含以下内容

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谷歌reCaptcha在本地服务器上工作,但不在在线服务器上工作 - Google reCaptcha working on local server but not in online server PHP文件上传在本地工作,但在服务器中工作 - PHP File Uploading working in local but not working in server php redirect()在联机服务器上不起作用 - php redirect() not working on online server 当不在本地服务器上时,PHP函数不起作用 - PHP functions not working when not on local server 网站在本地但不在在线服务器(WAMP)上运行 - Website working on local but not on online server (WAMP) AJAX呼叫在本地服务器上工作,但不在线 - AJAX call working on local server but not online Bootstrap在本地主机上运行,​​但不在联机服务器上运行 - Bootstrap working on Local Host but not on online server php头文件在localserver(垃圾服务器)上运行良好,但在联机服务器(000webhost)上运行不正常 - php header file working well on localserver (wamp server) but not working well on online server (000webhost) SQL查询在联机服务器上不起作用,在本地服务器上工作 - SQL query not functioning on online server, working on local server rest api(客户端)在本地服务器上工作正常,但在联机服务器上工作不正常 - rest api (client side) is working fine on local server but not on online server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM