Skip to content
Advertisement

dealing with forms in php

I have only one php file called index.php. I have created there a form with one input text element and one input submit element. When I click on submit I want to deal with the value from the input element in the function that is in the same file, namely index.php. So my question is what to write into action attribute of the form element, if i will write index.php it doesnt work properly because then I get to the dashboard of wordpress. (I am trying to create a wp plugin). –I am PHP and also WordPress beginner

Advertisement

Answer

I think the quickest way is just not to set any action on the form html tag. That way it will just POST/GET data to the same page from where you’re calling it. Does this make it for you?

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement