AJAX无法从xampp文件夹外部访问php [英] AJAX can't access php from outside xampp folder
本文介绍了AJAX无法从xampp文件夹外部访问php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编写了一个简单的html文件,它使用ajax从php文件中获取响应。
php文件只是回显一个字符串。
如果html文件和php放在c:/ xampp / htdocs中,一切运行良好。
我想要的是将html放在桌面上并调用php文件,它不会返回任何内容。
i猜它是一个apache,xampp配置,有人可以帮我plz ???
I wrote simple html file that use ajax to get response from a php file.
The php file is simply echo a string.
if the html file and the php is placed inside c:/xampp/htdocs and everything work well.
What i want is to place the html on the desktop and call the php file, it does not return anything.
i guess it is an apache, xampp confguration, can someone help me plz???
推荐答案
为什么你不能把它放在htdocs中?
And why can''t you put it in htdocs?
>
我可以,我尝试并成功。
但是当我将html放在桌面或htdocs之外的任何文件夹上时,ajax无法成功返回响应。
那么它是PHP,Apache还是浏览器问题?以及如何解决它。
谢谢
I can, and i tried it and succeed.
But when i place the html for example on the desktop or any folder outside the htdocs, ajax does not succeed in returning a response.
So it is a PHP, Apache or browswer problem? And how it can be solved.
Thank you
为什么需要解决它?把它放在htdocs中。
Why would you need to solve it? Just put it in htdocs.
这篇关于AJAX无法从xampp文件夹外部访问php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文