Dynamic Buttons
Images wrapped in anchor tags are a common navigational device. Instead of plain text, this method allows you to create buttons similar to those created in the operating system, or even fanciful icons. In most cases it is best to leave these as graphics created in your favorite graphics editor, because the time between changes is relatively long. On the other hand, if you have a button that changes often, it may make sense to create it dynamically with PHP. The content of the button, the label, needs to be available as a string in PHP. It could be a statement setting the value of a variable. It could also be a value retrieved from a file or a database.
An illustration will make this idea clear. Many corporate Web sites have a ...
Get Core PHP Programming: Using PHP to Build Dynamic Web Sites now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.