dongmei2351 2017-04-13 22:46
浏览 157
已采纳

如何在浏览器中显示/运行PHP文件? 好像是一个网页[重复]

This question already has an answer here:

How do I run a PHP file in my browser? I know what the file is for and I know how it looks because I tested it online. But now I downloaded it locally to my computer and I do not know how to run it on my browser. Is there a way maybe to link it to a HTML like you do with JavaScript or CSS to make it work on a web browser also after it is online how will I manage it to work?

If I can not link then maybe I can use iframe to see it in a HTML iframe. Is that possible? Yet the question is not based about iframe, but I do not exclude the iframe possibility too. That is why I ask of it too.

Or even better, if there is a way to both link and use iframe for the PHP?

The entire PHP file I got is a email function that works and looks a loot like a HTML and JavaScript file, but it is written in PHP. If I simply change the name to the file from PHP to HTML I can open it in the browser and it looks like a HTML file with few defects since it is a PHP file after all.

The file I downloaded was from here: https://www.hscripts.com/scripts/php/registrationMailer.php

And it is this PHP file I am specifically intrested in: https://www.hscripts.com/scripts/php/HMAD/hmailer.php

NOTE: I am not asking of "PHP code is not being executed, instead code shows on the page" as the other page is asking. I am asking of "How do I show / run a PHP file in a browser? As if it was a webpage."

</div>
  • 写回答

2条回答 默认 最新

  • dqsvf28682 2017-04-13 22:50
    关注

    You need to download a server, and install it. If you want to go to the trouble, you can get XAMPP, and once it's installed, move the PHP file to the root of your installation (usually c:\xampp\htdocs\ on windows) and then use the url localhost/script.php in your browser.

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

报告相同问题?

悬赏问题

  • ¥15 为什么eprime输出的数据会有缺失?
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题