+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [PHP] Prompt IE Users + Make Money

  1. #1
    Synkc's Avatar
    Synkc is offline Lord Of The Keys Synkc is an unknown quantity at this point
    Join Date
    Jun 2007
    Location
    Hervey Bay, Australia
    Posts
    1,765

    [PHP] Prompt IE Users + Make Money

    This is a quick an easy script which will show an “Incompatible Browser Detected” message to any end-user while they are using Internet Explorer. They will then have the option of downloading Firefox, or to continue browsing your site with Internet Explorer. You can also make money out of this with Google referrals ($1 per referral).

    PHP Code:
    if (stristr($_SERVER["HTTP_USER_AGENT"], "msie")){
        if (!isset(
    $_COOKIE["IgnoreFirefox"])) { 
            
    setcookie("IgnoreFirefox"time()+604800);
            echo
    "<div style=\"background:#e8fafe;border:#00586b 2px solid;padding:5px\">
            <span style=\"font-weight:bold;text-decoration:underline;font-size:25px\">Incompatible Browser Detected</span><br /><br />
            You are currently using Microsoft Internet Explorer, which is not fully compatible with this site.<br />
            It is recommended that you upgrade to a more W3C compilable web browser, such as <a style=\"text-decoration:none\" href=\"http://en.wikipedia.org/wiki/Firefox\">Mozilla Firefox</a>, the preferred browser for viewing this website. 
            Firefox may be downloaded for free from <a style=\"text-decoration:none\" href=\"http://firefox.com\">http://firefox.com</a>.<br /><br />
            You may continue browsing this site with Internet Explorer, however, you may experience issues regarding the display and rendering of page content.<br /><br />
            If you are experiencing issues bypassing this page, make sure that Cookies are enabled for this site.<br /><br /><br />
            <a style=\"text-decoration:none\" href=\""
    ."http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."\">Continue without Firefox &raquo;</a>
            </div>"
    ;
            exit;
        }


    How to use it

    You could use either a php include, or require function to include the code into each of your site pages, or place this code within a global.php, or config.php file, which all your site pages have access to. The code must be placed before any html output to the end user is declared; otherwise the script will throw an error; this is an requirement of the setcookie() function.


    How it works
    First off, this script will check whether the end-user has not received the cookie “IgnoreFirefox”; if they have, the rest of the code is not executed, and the user is free to view your site; otherwise, the script will send the incompatible browser notification, and sets the cookie. As such, users with Internet Explorer will need to allow cookies for your site; otherwise they will never be able to bypass this page.

    The browser detection is calculated with the code:


    PHP Code:
    stristr($_SERVER["HTTP_USER_AGENT"], "msie"
    It works by performing a search for the first occurrence of the keyword “msie” in the $_SERVER["HTTP_USER_AGENT"] array, and if the result returns true, they are using Microsoft Internet Explorer, and the “if” statement also returns true.

    You may ask, why am I using two “if” statements, instead of using an “and” operator to fuse the two together. Well this way, fewer resources will be extinguished by users using any browser other then IE; none of the code will be executed since the first if statement will return false (you don’t need to store a cookie on their machine if they are not using IE.

    Finally, the code:


    PHP Code:
    setcookie("IgnoreFirefox"time()+604800); 
    Will send the actual cookie to the browser; as we are only checking whether the cookie does not exist, giving it a value is not necessary. The time() function determines the length of time the cookie remains valid for; passing the time specified (604800 seconds) will result in the cookie begin destroyed, and the user will be prompted with the message again. The default time is set to one week.



    If you have any questions, feel free to ask.
    And I love suggestions and feedback. :P
    Last edited by Synkc; 12-13-2007 at 11:59 PM.
    E-mail: synkc[at]x10hosting[dot]com
    Hirokima.com

  2. #2
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: [PHP] Prompt IE Users + Make Money

    Nice one.

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  3. #3
    Derek is offline Community Support Force Derek is a splendid one to beholdDerek is a splendid one to behold
    Join Date
    May 2005
    Location
    cossacks
    Posts
    6,354

    Re: [PHP] Prompt IE Users + Make Money

    Example?

  4. #4
    GG-Xtreme's Avatar
    GG-Xtreme is offline x10 Lieutenant GG-Xtreme is an unknown quantity at this point
    Join Date
    Aug 2007
    Location
    BIG APPLE
    Posts
    430

    Re: [PHP] Prompt IE Users + Make Money

    I had something like this written in JavaScript a while ago, but too many people complained.

  5. #5
    t2t2t's Avatar
    t2t2t is offline x10 Elder t2t2t is an unknown quantity at this point
    Join Date
    Sep 2006
    Location
    Europe, Estonia
    Posts
    690

    Re: [PHP] Prompt IE Users + Make Money

    Quote Originally Posted by Derek View Post
    Example?
    http://habombers.com/
    Through this one shows the large text on top always.
    This post has been marked spam 52 times.


  6. #6
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: [PHP] Prompt IE Users + Make Money

    Since this only appears once per 24 hours, I suppose it wouldn't be too much of an irritant =)

    I've got something similar on my new upcoming site

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  7. #7
    Synkc's Avatar
    Synkc is offline Lord Of The Keys Synkc is an unknown quantity at this point
    Join Date
    Jun 2007
    Location
    Hervey Bay, Australia
    Posts
    1,765

    Re: [PHP] Prompt IE Users + Make Money

    I can't edit my first post, but here's a preview:

    http://hirokima.com/ie_warning.php

    and this link will delete the cookie:

    http://hirokima.com/ie_warning_reset.php
    E-mail: synkc[at]x10hosting[dot]com
    Hirokima.com

  8. #8
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: [PHP] Prompt IE Users + Make Money

    You should also do a sessions check just in case cookies are disabled they will see the message over and over again.

    Sessions won't get rid of the message but at the very least, you will only see them once per session. A more intensive way would be to store the IPs and time of last visit :D

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  9. #9
    Synkc's Avatar
    Synkc is offline Lord Of The Keys Synkc is an unknown quantity at this point
    Join Date
    Jun 2007
    Location
    Hervey Bay, Australia
    Posts
    1,765

    Re: [PHP] Prompt IE Users + Make Money

    Great idea, thanks for the suggestion
    E-mail: synkc[at]x10hosting[dot]com
    Hirokima.com

  10. #10
    Sharky's Avatar
    Sharky is offline Admiral Awesome Sharky will become famous soon enough
    Join Date
    Oct 2007
    Location
    Outside the USA
    Posts
    3,306

    Re: [PHP] Prompt IE Users + Make Money

    Only problem there is that the majority of sites aren't "not fully compatible" (double negative I know...), so it's just gimmicky rubbish.

    Kudos on knowing how to make this sort of thing though ;P
    The physics is theoretical but the fun is real.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Make real money from discussion
    By ivbsav in forum The Marketplace
    Replies: 1
    Last Post: 12-21-2006, 12:57 PM
  2. I Need To Make Money
    By SEÑOR in forum Off Topic
    Replies: 9
    Last Post: 05-24-2006, 04:11 PM
  3. InstantProfitz - The Easy way to make money!
    By frznmnky in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 04-15-2006, 04:12 AM
  4. For people who want to make money
    By IamShipon1988 in forum Off Topic
    Replies: 8
    Last Post: 08-21-2005, 03:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers