HTML Menu Bar Which Switches to Dropdown for Mobile
For a web site to be successful it must tick several boxes. It needs an attractive design, great content, no pop-ups, not throw to many advertisements at visitors and work well on a variety of screen sizes. The last point is important as mobile devices are now the dominant platform for accessing the web. Achieving multi-screen support from a single web site saves time (no need to update the design more than once). Time is a precious resource for most people and businesses.
A web site needs to respond to the device it is being viewed on, hence the term responsive design. When a website uses a menu to allow the viewer to jump to other pages, that menu should work well on different screen sizes. This article is a responsive menu tutorial giving an example implementation of the Responsive Nav plugin. This provides a basic responsive web site menu without using any other frameworks or libraries. As the screen shrinks the menu switches from traditional horizontal to a button. The button is used to dropdown the menu on smaller screens. Continue reading
View PHP Environment Configuration Settings and Superglobals on a Page
PHP is a great computer and web site scripting language and extremely popular. It is used primarily for developing interactive web sites and many use it for day-to-day programming tasks. There are several versions in general use and sometimes the configuration of PHP between servers and machines needs to be compared. The phpinfo() function is a one line solution to show the current live PHP set up. To show PHP settings simply create a one line PHP web file on the server containing <?php phpinfo(); ?> and point the browser at it. HTML tags are NOT required because the phpinfo() function pumps them out.
Note: phpinfo() outputs a lot of useful information, information that hackers find interesting so use it with care. Ideally do not have the phpinfo() page on a public facing web site. On the occasions you do take precautions to reduce information leakage. Put the page in a password protected directory, do not call it phpinfo.php as this is obvious to hackers (use something more obscure and a reminder to delete it when finished, e.g. quick-config-check.php), finally don’t forget to delete it when the PHP settings have been checked.
A PHP script will need access to other settings that PHP provides, often via system wide globals known as the superglobals. The $_SERVER array provides access to the _SERVER superglobal and is shown by phpinfo() in a table. Occasionally it can be worthwhile viewing such values from another PHP file. This can be done in a few lines of code. The following provides some details on showing PHP settings and global values in web pages.