php文件显示代码在Chrome
I have a register page I retrieved off of the following site. I downloaded the source code and extracted the file, finding the login.php
. I open it in Adobe Dreamweaver CS3 which loads it and shows no code, but when I click Preview in Chrome, Chrome shows the entire files code, which is shown below. When I click Preview in iExplore, it does the same. Am I doing something wrong or is there something I don't have on my laptop? I have not put the rest of the code for the webpage because I feel it is irevelent as when I cut the php code out and tested it it the page shows. It is just when I insert the PHP code. After the PHP is the normal code that Dreamweaver places in at the start of a new HTML or PHP file.
我有一个注册页面,我从下面的网站检索。我下载了源代码并提取了文件,找到了log .php。我在adobedreamweaver CS3中打开它,它加载时没有显示任何代码,但是当我在Chrome中单击Preview时,Chrome显示了整个文件代码,如下所示。当我在iExplore中点击Preview时,它也会这么做。我是不是做错了什么,或者我的笔记本上没有什么东西?我还没有把剩下的代码放到网页上,因为我觉得它很有用,就像我把php代码剪切出来并在页面上测试它一样。只是当我插入PHP代码时。PHP之后是Dreamweaver在新HTML或PHP文件开始时放入的普通代码。
<?PHP
require_once("./include/membersite_config.php");
if(isset($_POST['submitted']))
{
if($fgmembersite->Login())
{
$fgmembersite->RedirectToURL("login-home.php");
}
}
?>
4 个解决方案
#1
7
To display PHP on your computer you need to have a local PHP server set up. Without it there is no PHP engine that can interpret and parse your code to make it in to HTML for the browser.
要在计算机上显示PHP,需要设置一个本地PHP服务器。没有它,就没有PHP引擎能够解释和解析您的代码,使其成为浏览器的HTML。
If you haven't got a PHP server installed locally, then you will need to upload your files to a server via FTP, where PHP is installed.
如果没有在本地安装PHP服务器,则需要通过安装PHP的FTP将文件上载到服务器。
更多相关文章
- 怎么知道php代码运行时调用了那个类、那个方法呢?
- 配置文件定义常量 config.inc.php
- 来自多个文件的相同元素DomDocument loadHTMLFile PHP
- 无法使用dropzone上传多个文件
- 关注:PHP文件目录和文件本身的操作
- php exec文件从终端运行,而不是从浏览器运行
- PHP / Ajax:如何在成功登录后启动会话(剩余代码工作)
- log4php将不同级别的日志打印到不同的日志文件中
- PHP - 在外部服务器上读取文件?