更改返回获取目录
我试图理解为什么我不能将返回目录更改为我的/home
diquotory而不是tahn public_html
:
<script src="https://www.paypal.com/sdk/js?client-id=test¤cy=USD"></script>
<script>
// Render the PayPal button into #paypal-button-container
paypal.Buttons({
// Call your server to set up the transaction
createOrder: function(data, actions) {
return fetch('/home/mysite/public_html/checkfetch.php, {
method: 'post'
}).then(function(res) {
return res.json();
}).then(function(orderData) {
return orderData.id;
});
},
当我像上面的那样时,我需要的东西不是/home/mysite/public_html/checkfetch.php
但/home/checkfetch.php
I am trying to understand why I can't change return fetch directory to my /home
direcotory rather tahn public_html
:
<script src="https://www.paypal.com/sdk/js?client-id=test¤cy=USD"></script>
<script>
// Render the PayPal button into #paypal-button-container
paypal.Buttons({
// Call your server to set up the transaction
createOrder: function(data, actions) {
return fetch('/home/mysite/public_html/checkfetch.php, {
method: 'post'
}).then(function(res) {
return res.json();
}).then(function(orderData) {
return orderData.id;
});
},
It works when I make like above but what I need is not /home/mysite/public_html/checkfetch.php
but /home/checkfetch.php
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是在哪里托管的?在该主机上的Web浏览器(而非本地文件路径)上可访问的内容是可用于获取的内容。在服务器上建立有效的路线路径,然后使用这些路径。别无其他。
public_html
是Web路径中包含的异常事物。通常,这样的文件夹表示Web路径从哪里开始的文件系统根。Where is this hosted? Whatever is accessible in a web browser on that host (not a local file path) is what can be used for fetch. Establish valid route paths on your server, and use those. Nothing else.
public_html
is an abnormal thing to have included in a web path. Normally such a folder indicates the filesystem root of where web paths begin from.