I'm taking my first steps in writing plugins and I want to write one (as a first step of my project) that does the following:
1. A visitor goes to a page named "input" and the only 2 elements displayed in that page (other than the theme's) are a text field called "Address" and a "Submit" button.
2. The visitor enters their address and hits the button. As a result the address is saved in a global variable and added to the WordPress DB.
3. The visitor goes to another page called "output" and the only element displayed there is a non editable text field.
The address is extracted from the DB and displayed in that field.
For step 1:
a. I guess I need an action function here. And I know the page ID. But which hook do I use?
b. How do I display the text field and button? Do I need to give the field an ID?
c. How do I set their location in the page?
a. Do I need a filter or an action function here? Which hook?
b. What is the best way to insert the data into the DB? use wpdb class?
I guess when the first two steps are clear this one will be as well.