Vectorials
Flash Perfection
3D Lessons
Tutorialkit
Markup Tutorials
Learn PHP
network
adv banner
Web Programming  Home Web Programming PHP Last Modified and User's Screen Resolution Detection
rss

Last Modified and User's Screen Resolution Detection

Author: Kyscorp.com More by this author


Last Modified and User's Screen Resolution DetectionLast Modified

An easy and efficient way to write the date a file was last modified.

We call the function filemtime() that returns an integer (the number of seconds elapsed from Jan 1st, 1970 00:00 GMT)

Anyway, to make this integer viewable by human beings, we just format it using date() function.

<?
$file=$PHP_SELF; //Here's the file you wish to include. $PHP_SELF means current page
$mt=filemtime($file);
echo "This page was last modified on ".date("l F, d Y",$mt);

User's Screen resolution detection

Overview

This script allows the detection of the visitor screen resolution.

There's no PHP function that can detect the screen resolution, so the trick is to use a javascript code that reloads the page and that will capture the width and the height of the screen.

Script to be put on the top of the page

<?
if(empty($res))
{
echo '<script language="JavaScript">
<!-- debut
document.location="page.php3?res=1&w="+screen.width+"&h="+screen.height;
// end -->
</script>';
}
else
{
echo "Screen Resolution : ".$w."*".$h;
}
?>

Easy ain't it ? Carpe diem...



Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Last Modified and User's Screen Resolution Detection"