dpps0715 2015-07-09 17:56
浏览 37
已采纳

网站,无法读取php作为代码?

I have developed an website, and I was using just HTML, JS and CSS codes.
The pages are created like www.example.com/Home, it means no format...
My website was running well before i put this single line php code in it:

<?php include 'PageLoader_ST.php' ?>


Here is the code in screenshoot:
enter image description here



And here is the code read by Browser:
enter image description here
I am a little confused on how can i make it work? I don't wan't to use this format Home.php, is it possible anyway?

  • 写回答

3条回答 默认 最新

  • douhao2721 2015-07-09 18:07
    关注

    A file that should be parsed as php code, must have the file extension .php. There is no way around this.

    The url and the real file name on disk must not be the same. Very often (and when you use a framework, almost always) they do not correspond. This is achieved through url rewriting. With an Apache server this is done with a .htaccess file.

    You could use it to remove the .php extension.

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

报告相同问题?

悬赏问题

  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?