PLEASE RELOAD
Almost Techy





We've all used redirects when we've modified our website. In PHP you can use location and it will direct to your dot com index, or any webpage you specify after the colon. Here's the code that directs to your dot com index..

<? header('Location: /'); exit; ?>




If you like and use Server Side Includes, you're going to love them php style. Includes can be anything, any extension. Wherever you put the include, that's where it will show up. The page being included ONLY contains what you want on the page..no <html> tag, etc...just what you want to be seen. Here's what it looks like on the page.

This text has been put on the page by a PHP include. The text is actually on another page.

Here's how you "include" it.
<? include('http://simplysally.com/tut/PHP/phpinclude.html'); ?>




We've all gone to websites that tell us what our browser is and gives the IP number. This is not a hack script and no one gets into anything of yours by using it. It's just a small php script. Here's the code for it.

<p>You are using <?php echo $_SERVER['HTTP_USER_AGENT']; ?><br> and coming from <?php echo $_SERVER['REMOTE_ADDR']; ?><br>

Here's what it looks like on the page.

You are using CCBot/2.0 (http://commoncrawl.org/faq/)
and coming from 107.22.60.105





How about you make your own countdown banner? This little script will do that.

<?php

// Change this to the day in the future

$day = 1;

// Change this to the month in the future

$month = 1;

// Change this to the year in the future

$year = 2016;

// You do not need to edit below this line

$days = (int)((mktime (0,0,0,$month,$day,$year) -

time(void))/86400);

echo "There are $days days until $day/$month/$year";

?>

Here's what it looks like on a page put in a table...

There are -480 days until 1/1/2016





This little script will tell your visitors the date and time. It prints it in two ways....You may choose one or the other by commenting out the lines not needed. Here's the code for it:

<?php
$time = time();
//print date("m/d/y G.i:s", $time);
print "<br>";
print "Today is ";
print date("l dS \of F Y h:i:s A", $time);
?>


Here's how it looks on the page.


Today is Wednesday 26th of April 2017 12:05:55 AM




This little script will greet your visitors the depending on the time of day. Here's the code for it:

<?php
$theDate = date("H");
if($theDate < 12)
echo "Good morning to you";
else if($theDate < 18)
echo "Good afternoon to you";
else
echo "Good evening to you";
?>


Here's how it looks on the page.

Good morning to you




This little script will tell the seasons It depends on the day number of the year. Here's the code for it:

<?php echo "It is day " . date('z') . " of the year. "; ?>
<?php $theday = date('z');
if($theday >= "79" && $theday <= "170") { $season = "Spring";
} elseif($theday >= "171" && $theday <= "264") { $season = "Summer";
} elseif($theday >= "265" && $theday <= "355") { $season = "Autumn";
} else {
$season = "Winter"; }
echo "It's " . $season . "!";
?>


Here's how it looks on the page.

It is day 115 of the year. It's Spring!




Here's a tiny counter for your webpage and only you will know it's there and only you will know the count. Just grab this zip file.  Counter

Unzip it in the same directory as your page and put this at the bottom of your page you want counted.

<img src="counter.php" height="1" width="1" border="0">

Consult the txt file for your count.




Back SiteMap