Form action | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Form action

can someone explain to me in more simple terms what does the <form action> function do in a website? is it any real need? I don't get what it does

18th May 2017, 3:30 PM
Hunter Carwile
Hunter Carwile - avatar
5 Answers
+ 7
<form action="Signup.php" method="GET|POST"> form elements like input, textarea etc. </form> actionand method are are attributes if a form. action : Backend script (signup.php) ready to process your passed data( ) method Method to be used to upload data. The most frequently used are GET and POST methods. target Specify the target window or frame where the result of the script will be displayed. It takes values like _blank, _self, _parent etc. https://code.sololearn.com/wnZ71XPSeNp0/?ref=app Abovz SL link is a sample of my code but did the form in PHP. Hope you will understand.
18th May 2017, 4:14 PM
Awele Omeligwe
Awele Omeligwe - avatar
+ 2
i hope i understand your question right. form is a formular tag which is used to get information that the user entered in the formular. you need the action attribute of a form tag to define to which page the informations will send if the user klick the submit button. as example a contact formular: user entered his name and phone number and click a send button. now all informations in the form tag (formular) will send to the URL which is defined in action part of the tag
18th May 2017, 4:08 PM
Oliver
+ 1
@Oliver so essentially form is just the information stored within a site like profile info? So if I put in form data and put say a username that form data is that usrrname?
18th May 2017, 4:18 PM
Hunter Carwile
Hunter Carwile - avatar
+ 1
@silver every form sends his data to a target which is defined in action part if submit button will clicked. method defines if the data will transfered by the URL of your browser (GET method) or hidden (POST method, usefull for password data or something like that) for example: your define a form with GET method and action hello.php in your form you have an input field for entering users name with name username. (for example the user entered "oliver") after submitting your browser URL shows domething like this ...hello.php?name=oliver you can use this information in hello.php like this: $_GET ['name'] this variable has the value oliver i hope this helps you
30th May 2017, 4:44 PM
Oliver
0
i need help
30th May 2017, 4:12 PM
Devon John
Devon John - avatar