SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast Scott Botkins's Avatar
    Join Date
    Jun 2003
    Location
    cincinnati
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    show ad based on screen resolution?

    Hey guys, I was wondering if you had any idea how to show a ad based on screen resolution. Sort of like how espn.com has it...when your on 800 by 600 it doesn't show the ad and msn table on the right but when you are on 1024 or higher it does. Does anyone have any idea how to do this?

    Thanks,
    Cincinnati Web Design - Creative Web Design by Scott Botkins

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Scott

    I think what you need is Javascript for this. This question belongs in the JS forum. The good news is it is easy to do, but it should be answered in the correct forum.

    Cheers

  3. #3
    SitePoint Enthusiast Scott Botkins's Avatar
    Join Date
    Jun 2003
    Location
    cincinnati
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well i was kinda of hoping there would be a php one so i wouldn't have to use java. Because not all browsers support java.
    Cincinnati Web Design - Creative Web Design by Scott Botkins

  4. #4
    SitePoint Guru okrogius's Avatar
    Join Date
    Mar 2002
    Location
    US
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Repeat after me:
    Java is not Javascript
    Javascript is not Java
    PHP is server side scripting language
    Javascript is a client side scripting language

  5. #5
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Java is not Javascript
    Javascript is not Java
    PHP is server side scripting language
    Javascript is a client side scripting language
    Quoting, because this is very important.

  6. #6
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry to be annoying - but think of the logic. That's like asking Apache to log what video card driver you are using. Or what song you are currently playing. It's impossible! Only on the client side can you get CLIENT INFORMATION unless it is sent to PHP otherwise (for example, the user agent gives browser/OS information).

    The way to do it is to have a default ad to show if JS is disabled. Make it the smallest ad. Also, forget about the 1/1000th of a percent of the users who still use browsers that don't support JS. Find me a browser that is on any of your Cpanel logs (or whatever you use) that doesn't support JS.

    My 2 cents.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •