PHP is open source scripting language. It\'s widely used to develop web applications.  Home Web Programming PHP Last Modified and User's Screen Resolution Detection
Your Ad Here

Last Modified and User's Screen Resolution Detection


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...



Author's URL: Kyscorp.com
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Web programming � everything from the basics of visual design and architecture to the specifics of applications, graphics, and scripting. More Web Programming: Most Popular Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

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

Only registered users can write comment

No comments yet...