Getting multiple checkbox values in PHP

If you give the checkboxes the same name, ending in [], the values are returned as an array.

Then in PHP …

 

Read more

Default argument values in function declaration

A function may define C++-style default values for scalar arguments as follows:  Example #3 Use of default parameters in functions

The above example will

Read more

using global variables inside a function

I used the global declaration and it works. You have to pass it to the function:

or declare it global:

If the variable isn’t

Read more

Remembering form values after submit

Text field: <input type=”text” name=”Fname” value=”<?php echo isset($_POST[‘Fname’]) ? $_POST[‘Fname’] : ” ?>” > Radio button: <input type=”radio” value=”Fvalue” name=”field_name” <?php if(isset($_POST[‘field_name’]) && $_POST[‘field_name’] == ‘Fvalue’)

Read more