1

I am running XAMPP in order to use PHP on my local computer. I put all of my scripts inside of the htdocs folder (the default location). Everything used to work great until recently. For example, if I click on an HTML file in htdocs, the file opens up in a browser(like it should). But, if I click submit on a form with an action set to "some-script.php" It goes to the php page and displays the php code. Now, if I type into my browser "localhost/some-html.html" then it works? Why is that? What could I be doing wrong??

4

2 回答 2

5

当您通过在地址栏中键入“localhost/some-html.html”来访问它时,您使用 XAMPP 的服务器和 PHP 引擎来访问该页面,当您只需双击文件夹中的文件时,您只是使用默认打开文件程序(恰好是您的浏览器)

于 2012-07-27T00:29:21.673 回答
0

定义一个基本 url 变量,如 $baseurl = "http://localhost/foldername/",并在您的操作中使用此变量,如 action = "example.php"。

于 2012-07-27T08:08:55.970 回答