This tutorial explains how to use checkboxes in PHP to get values which are checked by the user. Use checkboxes in PHP and insert the values into MySQL. Usually using other HTML form controls with PHP is easy. The input element is assigned a name and values entered can be retrieved using GET or POST method. But in the case of checkboxes it might be ticked or left empty also. Using checkboxes in PHP involves setting the name attribute of all checkboxes to a common name with an empty square bracket denoting an array. When the form is submitted the vales of the items checked are send as an array which is explained hereContinue Reading…
Running PHP code in HTML files
PHP can be useful when used in conjunction with html. Even if you don’t plan create full blown dynamic pages certain functions like server side includes can help you repeat the code less for commonly used things like menus and advertisements. But it can be irritating to end the file with a .php extension just because you’ve added a snippet of PHP code. Also some people say that pages with a .html extension rank more in search engines when compared to .php. I don’t know how far its true and I’ll leave it in your hands to experiment.
In this article I’ll focus on the things needed to be done for html to be parsed by the server. (More about this word later)Continue Reading…