How-to articles, tricks, and solutions about FORMS

How to run a PHP function from an HTML form?

To run a PHP function from an HTML form, you will need to create an HTML form with the desired inputs, such as text fields and submit buttons.

How to set a class attribute to a Symfony2 form input

In Symfony2, you can set the class attribute of a form input by using the "attr" option in the form field configuration.

PHP form - on submit stay on same page

To stay on the same page after a form submission in PHP, you can use the following steps.

posting hidden value

In PHP, you can post a hidden value by including it in a hidden input field within a HTML form.

Send html form data to sql database via php (using mysqli)

To send HTML form data to a SQL database using PHP, you will need to use the mysqli (MySQL Improved) extension in PHP.

Send value of submit button when form gets posted

In PHP, you can access the value of a submit button when a form is posted in the following way:

submit a form in a new tab

To open a form submission in a new tab, you can use the target attribute of the form element and set it to _blank.

Why is textarea filled with mysterious white spaces?

There could be a number of reasons why a textarea element in a PHP webpage might be filled with mysterious white spaces.