更改返回获取目录

发布于 2025-01-18 04:02:04 字数 861 浏览 4 评论 0原文

我试图理解为什么我不能将返回目录更改为我的/home diquotory而不是tahn public_html

 <script src="https://www.paypal.com/sdk/js?client-id=test&currency=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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

高速公鹿 2025-01-25 04:02:04

这是在哪里托管的?在该主机上的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文