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


Related Articles

  • The Screen Resolution Problem
    I used to come across this problem almost every time I looked around the web. I would get to a web site that has a nice design, but I could not see everything without scrolling sideways with the bottom scrollbar in my browser!
  • No-one wants to look at the screen
    One of the most fundamental factors in designing for screen-based media is: No-one likes looking at a computer screen...
  • Website Designing with Browser Compatibility
    In the early days of the Internet, many sites advertising Best viewed with Netscape or Best viewed with Internet Explorer or the like. These days, such labels seem to be rarer. Web designer today put an inordinate amount of effort to promote their sites on the search engines.
  • Screen Size Compatibility Can Make Or Break Your Design
    Have you ever visited a Web site that looked, well
  • JavaScript Browser Detection
    Browser detection allows you to find out what browser your viewer is using, and then perform a script based on it - or just to send a friendly message to those with your favorite browser.
  • Anonymous Visitor Marketing
    Several kinds of data are attached to each internet users communications. This is known as metadata or supplemental data. This data provides a profile of each visitor to a website that can and should be used as marketing data.
  • Liquid VS Fixed Layout Debate In Modern Web Design
    This very informative article will help you to understand the continued comparison of benefits and liabilities of Liquid VS Fixed Layout. The author explains when a mixed approach works best.
  • Is Your Site Too Slow? Why Image Optimization Is Critical When You Create A Web Site
    Graphics are fun, but if you put in too many bells and whistles when you create your web site, you may lose a potential audience whose Internet connection can
  • Should I use Flash in my Web Site?
    Use Flash with care, advises Luke Humble. Understand your audience, and view your intended animation in a variety of environments before releasing your site.
  • Full Screen
    Javascript allows you to display a page in full screen via a button, the script consists of 2 parts, the first one will be inserted between the and tags is:

Contact Web Design Outsource and get started today

Need Website Designing, Development, Redesigning, Maintenance and SEO services or help growing your company's web presence? Request a free Quote Now.