I have a script folder and a html folder that are in the same folder. In the html folder there is a registration.php page which should send the form to register.php which lies in the script folder. Posted by:

<form method="post" action="../script/register.php"></form> 

where is the mistake? if he refers to

 /html/script/register.php 

    1 answer 1

    Relative paths in html are calculated relative to the base address, which does not necessarily coincide with the address of the current page. For example, it can be explicitly set with the <BASE href=... > . Therefore, it is better to indicate the absolute way?

    From the question is not quite clear the folder structure.

    • www / cgi-bin / register.php www / html / registration.php www / index.php This is how the index is located. PHP refers to registration. PHP, and Registration. PHP is registered. PHP : Dikaz
    • I understood what BASE is but didn’t quite figure out how it works. I register the absolute address in the head? Or is it relative? From the root of the site? And how can I refer to it after the address is announced? - Dikaz
    • Are you sure that the root of the website you have in www/ , and not www/html/ , for example? Normally, cgi-bin is located outside, but the web server appears as if site.com/cgi-bin/ . For the described folders, in registration.php path to register will look like ../../cgi-bin/register.php The <base> is written in <head> . - Sergiks
    • I'll write all the way O: \ home \ emektep.kz \ www \ html \ registration.php O: \ home \ emektep.kz \ www \ cgi-bin \ register.php O: \ home \ emektep.kz \ www \ index. php - Dikaz
    • decided to score on these links. and enter the php code in the page itself - Dikaz