PHP仅显示脚本文本 [英] PHP shows script text only

查看:79
本文介绍了PHP仅显示脚本文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft Expression Web 4,我下载了一个所有PHP文件的模板。当我将文件放入Expression Web 4并推送预览时,它会显示脚本的文本。这是脚本。有什么不对?我是非常新的
脚本和非常新的PHP。有人可以帮我吗?
$


<?php

/ **

* @package WordPress

* @subpackage Default_Theme

* /



//不要删除这些行

if(!empty($ _ SERVER ['SCRIPT_FILENAME'])&&'comments.php'== basename($ _ SERVER ['SCRIPT_FILENAME']))

die('请做不直接加载此页面。谢谢!');
$


if(post_password_required()){?>

< p class = "nocomments"><?php _e('此帖子受密码保护。请输入密码以查看评论。','nattywp'); ?>< / p>

<?php

return;

}

?>



<! - 你可以在这里开始编辑。 - >
$


<?php if(have_comments()):?>

< h2><?php comments_number(__('无响应','nattywp'),__('一个响应','nattywp'),__('%回应','nattywp'));?>< / h2>

< div class =" inner-text">



<?php if(get_comment_pages_count()> 1&& get_option('page_comments'))://是否有评论要浏览? ?>


< div class =" navigation">

< div class =" alignleft"><?php previous_comments_link(__( '< span class =" meta-nav">& larr;< / span>旧评论','nattywp')); ?>< / div>

< div class =" alignright"><?php next_comments_link(__('较新评论< span class =" meta-nav"> ;& rarr;< / span>','nattywp')); ?>< / div>

< / div>< div style =" clear:both;">< / div>

< ;?php endif; //检查评论导航?>





< ul class =" commentlist">

<?php wp_list_comments('风格= UL&安培;回调= mytheme_comment'); ?>

< / ul>



<?php if(get_comment_pages_count()> 1&& get_option( 'page_comments'))://是否有评论可以浏览? ?>


< div class =" navigation">

< div class =" alignleft"><?php previous_comments_link(__( '< span class =" meta-nav">& larr;< / span>旧评论','nattywp')); ?>< / div>

< div class =" alignright"><?php next_comments_link(__('较新评论< span class =" meta-nav"> ;& rarr;< / span>','nattywp')); ?>< / div>

< / div>

<?php endif; //检查评论导航?>

< div style =" clear:both;">< / div>< br />< br />

< / div>

<?php else://如果到目前为止没有评论,则会显示这些内容吗?>
$


< ?php if('open'== $ post-> comment_status):?>
$
<! - 如果评论已打开,但没有评论。 - >



<?php else://评论已关闭?>

<! - 如果评论是关闭。 - >

< p class =" nocomments">< / p>



<?php endif; ?>
$
<?php endif; ?> b


<?php

$ defaults = array(

'id_form'=> 'comment-form',

'id_submit'=>'submit',

'title_reply'=> __('留下回复','nattywp') ,$
'title_reply_to'=> __('留下回复%s','nattywp'),

'deckage_reply_link'=> __('取消回复','nattywp'),

'label_submit'=> __('发表评论','nattywp')

);



comment_form($ defaults); ?>
I am using Microsoft Expression Web 4 and I downloaded a template that is all PHP files. When I put the files into Expression Web 4 and push preview, it shows the Text of the script. This is the Script that it is. Is there something wrong? I am very new to scripting and VERY new to PHP. Can someone help me out?

<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/

// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');

if ( post_password_required() ) { ?>
<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.','nattywp'); ?></p>
<?php
return;
}
?>

<!-- You can start editing here. -->

<?php if ( have_comments() ) : ?>
<h2><?php comments_number(__('No Responses','nattywp'), __('One Response','nattywp'), __('% Responses','nattywp'));?></h2>
<div class="inner-text">

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'nattywp' ) ); ?></div>
<div class="alignright"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'nattywp' ) ); ?></div>
</div><div style="clear:both;"></div>
<?php endif; // check for comment navigation ?>


<ul class="commentlist">
<?php wp_list_comments('style=ul&callback=mytheme_comment'); ?>
</ul>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'nattywp' ) ); ?></div>
<div class="alignright"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'nattywp' ) ); ?></div>
</div>
<?php endif; // check for comment navigation ?>
<div style="clear:both;"></div><br /><br />
</div>
<?php else : // this is displayed if there are no comments so far ?>

<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->

<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"></p>

<?php endif; ?>
<?php endif; ?>

<?php
$defaults = array(
'id_form' => 'comment-form',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply', 'nattywp' ),
'title_reply_to' => __( 'Leave a Reply to %s', 'nattywp' ),
'cancel_reply_link' => __( 'Cancel reply', 'nattywp' ),
'label_submit' => __( 'Post Comment', 'nattywp' )
);

comment_form($defaults); ?>

推荐答案

 

感谢您的发帖! 我建议将你的问题发布在MS论坛之一,

表达式
>
论坛主页 < span style ="color:#000000">
>
Expression Studio论坛
> Expression Web和SuperPreview,

Expression > Forums Home > Expression Studio Forums > Expression Web and SuperPreview,

位于此处: 
http://social.expression.microsoft.com/Forums/en/web/threads

祝你有个美好的一天!


这篇关于PHP仅显示脚本文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆