<!-- Home|Web Hosting/Design ->
<!--PHP Code-->

PHP Samples

These are a few of my favorites:
<?php // print out the date 
$getdate = date( "dS of F Y" );
$gettime = date( "g:i:s: A", time() + $zone=3600* );
PRINT "$getdate<br>";
PRINT "$gettime";
?>
Which will display this: (hint: Use the drop down to adjust for your timezone)
20th 2018f August 2018
5:21:36: AM
<?php
echo "Referer: " . $_SERVER["HTTP_REFERER"] . "<br>";
echo "Browser: " . $_SERVER["HTTP_USER_AGENT"] . "<br>";
echo "User's IP address: " . $_SERVER["REMOTE_ADDR"];
?>
Which will display the folowing info:

Referer:
Browser: CCBot/2.0 (https://commoncrawl.org/faq/)
User's IP address: 54.225.38.2
<?php 
$quote[0]="Quote 1";
$quote[1]="Quote 2";
$quote[2]="Quote 3";
$quote[3]="Quote 4";
$quote[4]="Quote 5";
$randnum=mt_rand(0,4);
echo $quote[$randnum];
?>
Which will display the following random quotes.
{hint - make sure you change (0,4) to however many quotes you use ie. (0,11)}

Quote 3

"Courage is the mastery of fear, not the absence of fear."- Mark Twain