doumi7854 2015-11-10 11:04
浏览 65
已采纳

网页echos php脚本部分

I have recently setup a Fedora 20 VPS with LAMP. My PHP is working properly as you can see from output below: http://talkoot.co.in/info.php

My problem is when I access page below, the php script is printed out instead of being executed. If one 'Views Source' then the entire code is visible. http://talkoot.co.in/WebBackend/admin/login.php

Can someone help me out. Here is the code for login.php:

<?php
include 'init.php';
if(isset($_SESSION['admin'])){
    header('Location: index.php');
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>Login - CPanel</title>
    <link type="text/css" rel="stylesheet" href="libs/css/materialize.min.css"  media="screen,projection"/>
    <link type="text/css" rel="stylesheet" href="libs/css/style.css"  media="screen,projection"/>

</head>
<body>
<div class="container">
    <div class="card publish-form-container">
        <?php
        if(isset($_POST['username'],$_POST['password'])){
            $__USERS->adminLogin($_POST);
        }
        ?>
        <form  class="col s12" method="POST" action="" >

            <div class="input-field">
                <input id="username-field" type="text" name="username">
                <label for="username-field">Username...</label>
            </div>
            <div class="input-field">
                <input id="password-field" type="password" name="password">
                <label for="password-field">Password...</label>
            </div>
            <div>
                <button class="btn waves-effect waves-light pull-right" type="submit">Login
                    <i class="mdi-content-send right"></i>
                </button>
            </div>
        </form>
    </div><!-- Post Card //-->
</div>

<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="libs/js/materialize.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('.materialboxed').materialbox();
    });
</script>
</body>
</html> 
  • 写回答

2条回答 默认 最新

  • duanmi1900 2015-11-10 11:27
    关注

    Your server is not enabled for Short Open Tag there are 2 scenarios

    1. enable it from php.ini short_open_tag = On or using htaccess
    2. Use <?php instead of <?

    P.S: i have shared a link which can explain you why i presented 2 options

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器