Guys what does it mean when the action attribute of a form is set this way. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Guys what does it mean when the action attribute of a form is set this way.

<form action="./" method ="post"> What is the ./ used for ?

13th Nov 2017, 1:10 PM
Franklyn Omeben
Franklyn Omeben - avatar
3 Answers
+ 4
The action attribute is using relative path, "./" refers to current directory/folder, "../" refers to a directory on a higher level of hierarchy (parent directory). Read about relative and absolute path in the following link: https://www.w3schools.com/html/html_filepaths.asp
13th Nov 2017, 1:17 PM
Ipang
+ 2
that is to say the form is submitted to it self for processing right?
14th Nov 2017, 10:15 AM
Franklyn Omeben
Franklyn Omeben - avatar
+ 1
I cannot tell for sure mate, for all I know, if you're submitting form data to the same file for processing, usually it is left as empty string, or omitted. However, if the file is named 'default' or 'index' it will most likely be the default filename used for current directory, appointed by './' attribute. Have you verified if such setting routes the data back to the file? maybe make a test file for that reason.
14th Nov 2017, 10:40 AM
Ipang