-3

It worked perfectly when the same .PHP files (the one with the form and the action one) were inside the some folder. But for security reasons I need the 'action' file outside the folder with another path.

I'm writing the code correctly (I guess):

action="../connect/dashboard/admin/register_dw_user.php"

    

It doesn't make sense to me, it's clearly that I'm missing something. But I don't know what.

And the connect.php file to link the MYSQL DB is working perfectly, and it's also inside the same 'connect' folder. I'm using:

       include '../connect/lib/connect.php';

That made clear that the 'connect' folder is just one above the 'public' one. But for some reason isn't working with the action form.

This is what I tried and didn't worked:

 action="/connect/dashboard/admin/register_dw_user.php"
 action="../connect/dashboard/admin/register_dw_user.php"
 action="../../connect/dashboard/admin/register_dw_user.php"
 action="../../../connect/dashboard/admin/register_dw_user.php"
 action="connect/dashboard/admin/register_dw_user.php"

Any idea? PLEASE! I need Help!

screenshot form code

the file it's on the server

I just keep pulling the 404, help...

1 Answers1

0

You should always use absolute paths especially when you're accessing files from different folders

For offline usage This is if you are not even trying to render php,just testing if the submit button calls the right file

For example say your form.htm is located at [Drive]/myname/admin/data/form.htm
and your processor.php is at [SameDrive]/myname/admin/data/anotherdata/processor.php

to call that php file from htm you set your action to action="/myname/admin/data/anotherdata/processor.php"

For localhost or server[if you are on server] usually the path is either "www/" or "www/root/"

say your form.htm is located at www/root/admin/data/form.htm
and your processor.php is at www/root/admin/data/anotherdata/processor.php

you can now use action="/admin/data/anotherdata/processor.php"

Alternatively

You could add url before the path like:

action="https://myurl.com/admin/data/anotherdata/processor.php" 
Kevin Gales
  • 532
  • 4
  • 9