PHP is a scripting language that is used for web development. I'm attempting to learn how to use it.
Playing with the $_SERVER predefined variable.
- $_SERVER['SCRIPT_FILENAME'] will give the file name that is running. Like this:
/home/kreide5/public_html/tim/php/learnphp.php
- $_SERVER['HTTP_USER_AGENT'] will show what the user is using to view this page. Like this:
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
- $_SERVER['SERVER_SOFTWARE'] will give information about the server holding this page. Like this:
Apache
There are predefined constants in php. One of them is PHP_VERSION.
This is what it shows you (the version of php on the web server):
7.2.34
I will use an array to create this drop-down menu:
Move on to Chapter Three to look at the creation of dynamic websites.
Take me back to the previous php page.