I
I
Ivan Ivanovich2020-02-03 11:15:07
URL Handling
Ivan Ivanovich, 2020-02-03 11:15:07

Can't get the file path right?

When developing the site, I made an ajax script that makes a request to a php file.

The path to the php file is written as follows: Everything worked fine on the local server, but uploading it to the hosting, when accessing the file, such an error occurs . As I understand it, the script cannot find the path to the file. I tried ../ and / didn't help. Line 108 PS I'm sorry, the problem turned out to be very simple. The fact is that I added commands to htaccess in order to remove the extension, and on the local server the file was opened by send.php, and when uploading to the hosting and adding the htaccess file, in order to remove the extensions, it was necessary to simply send it.
request.open('POST', '/src/php/send.php', true);

5e37d63a12e48305645578.png


console.log(request.response);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AUser0, 2020-02-03
@IwanQ

So check the existence of this file by opening the address http:// your_site_address_here /src/php/send.php in your browser , of course replacing your_site_address_here with the address of your site.
And apparently you will also be shown an error 404 - "File not found".

I
Ivan Ivanovich, 2020-02-03
@IwanQ

I'm sorry, the problem turned out to be very simple. The fact is that I added commands to htaccess in order to remove the extension, and on the local server the file was opened by send.php, and when uploading to the hosting and adding the htaccess file, in order to remove the extensions, it was necessary to simply send it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question