简体   繁体   English

Croogo和CakePHP-PHP代码显示在HTML源代码中

[英]Croogo and CakePHP - PHP code showing up in HTML source

I am running a wamp server and I installed croogo, then when I replaced the app folder with a site I am developing for a client I started to see the php code showing up in parts of the html. 我正在运行一个wamp服务器并安装了croogo,然后当我将一个应用程序文件夹替换为一个正在为客户端开发的站点时,我开始看到php代码显示在html部分中。 Everything worked fine until I replaced the app folder. 一切正常,直到我替换了app文件夹。

You can view the code here http://lytroo-tmp.dyndns.org/croogo5/users/login , I am not sure why it is reacting the way that it is. 您可以在此处查看代码http://lytroo-tmp.dyndns.org/croogo5/users/login ,我不确定为什么它会以这种方式做出反应。 Only small parts of the php source is outputting in the html, but it caused errors throughout the whole site because the code is not running. 仅一小部分的php源代码在html中输出,但是由于代码未运行,它在整个站点中引起了错误。

EDIT Seems that is issue is just in the .ctp files. 编辑似乎仅在.ctp文件中存在问题。 If the php tag does not contain '' and is just '' it outputs as html. 如果php标记不包含“”而只是“”,则输出为html。 How would you solve this? 您将如何解决?

let me know if you need more information. 如果您需要更多信息,请与我们联系。

It looks like part of the PHP is being read as text so you should go through the code and make sure that you've correctly opened the php code segment: 看起来PHP的一部分正在作为文本读取,因此您应该遍历代码并确保已正确打开php代码段:

<?php 
     echo 'other code';
     sessionFlash(); 
?>

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM