Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    6
    Member #
    33459
    I found a very usefull and simple age verification script in another thread.

    The problem is that it suddenly doesnt work in google chrome.

    I have an indication that it has something to do with the header location function. http://stuporglue.org/chrome-not-red...tion-redirect/

    But I havent the skills to get it working, think I have tryed everything.

    The two page script:

    first the verify page---

    PHP Code:
    <?php
    session_start
    ();
    if (
    $_REQUEST["over18"] == 1) {
        
    $_SESSION["over18"] = 1;
        
    header("Location: " $_REQUEST["redirect"]);
    }
    ?>

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta....
    </head>
    <body>

                   <div class="centre">
         <a href="verify.php?over18=1&redirect=<?=$redirect?>" class="button1">Es esmu vismaz 18</a>
            <a href="http://www.google.com/" class="button1">ne</a>
    </div>

            </div>

    </body>
    </html>
    The require verification script that lets bots through:

    PHP Code:
    <?php
    session_start
    ();
    function 
    isBot($httpUserAgent){
    $crawlers 'Googlebot|Google|msnbot|Rambler|Yahoo|AbachoBOT|accoona|' .
    'AcioRobot|Lynx|ASPSeek|CocoCrawler|Dumbot|FAST-WebCrawler|' .
    'GeonaBot|Gigabot|Lycos|MSRBOT|Scooter|AltaVista|IDBot|eStyle|Scrubby|'.
    'Bloglines subscriber|Dumbot|Sosoimagespider|QihooBot|FAST-WebCrawler|'.
    'Superdownloads Spiderman|LinkWalker|msnbot|ASPSeek|WebAlta Crawler|Lycos|FeedFetcher-Google|Yahoo|YoudaoBot|AdsBot-Google|'.
    'Scooter|Gigabot|Charlotte|eStyle|AcioRobot|GeonaBot|msnbot-media|Baidu|CocoCrawler|Google|Charlotte t|Yahoo! Slurp China|Sogou web spider|YodaoBot|MSRBOT|AbachoBOT|Sogou head spider|AltaVista|IDBot|Sosospider|Yahoo! Slurp|Java VM|DotBot|LiteFinder|Yeti|Rambler|Scrubby|Baiduspider|accoona';

    $isCrawler = (preg_match("/$crawlers/i"$httpUserAgent) > 0);
    return 
    $isCrawler;
    }

    if(!
    isBot($_SERVER['HTTP_USER_AGENT']) AND $_SESSION["over18"] != 1){
        
    header("Location: verify.php?redirect=" $PHP_SELF);
    }
    ?>
    And offcourse there is a require line on all the pages tha needs verification:

    <?php include("require_verification.php");?>

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Please define "not working"... Is it just letting all google chrome browsers by without the verification? Or is it jus lt stopping ?

  4. #3
    Junior Member
    Join Date
    Oct 2012
    Posts
    6
    Member #
    33459
    Quote Originally Posted by Webzarus, post: 243453
    Please define "not working"... Is it just letting all google chrome browsers by without the verification? Or is it jus lt stopping ?
    It is not getting past the verification. It stops at the verification page. Its only a problem in chrome.

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    So it appears as though the function is set to allow any user_agent that displays a common string of a crawler to just to by without doing anything ? Correct ?

    And if it displays anything else its suppose to stop and require verification ? Correct ?

    So in chrome, since it has an object inspector, are you running it to see what happens ? ... It should show you what is happening when the browser hits the page.

    I think since you have Temne word "google" in the function, the script is getting confused since googles crawler doesn't identify itself as "google"... But most site scrapers do... Or at least the poorly designed ones do.

    Remove the word google from your function... And see what happens with chrome

  6. #5
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Personally, I'd use IP blocks as filters for the legitimate crawlers... It's very easy to make a browser display a user_agent string that mimics a search crawler...

    Sure you can spoof IP addresses, but that usually entails some sort of proxy that can also be detected and filtered. And spoofing without a proxy is difficult for most people.

  7. #6
    Junior Member
    Join Date
    Oct 2012
    Posts
    6
    Member #
    33459
    Quote Originally Posted by Webzarus, post: 243728
    So it appears as though the function is set to allow any user_agent that displays a common string of a crawler to just to by without doing anything ? Correct ?

    And if it displays anything else its suppose to stop and require verification ? Correct ?

    So in chrome, since it has an object inspector, are you running it to see what happens ? ... It should show you what is happening when the browser hits the page.

    I think since you have Temne word "google" in the function, the script is getting confused since googles crawler doesn't identify itself as "google"... But most site scrapers do... Or at least the poorly designed ones do.

    Remove the word google from your function... And see what happens with chrome
    Yes allows all bots to pass
    Yes all "ordinairy" user will hit the verification page
    No, not running the object inspector - Isnt that for javascript.

  8. #7
    Junior Member
    Join Date
    Oct 2012
    Posts
    6
    Member #
    33459
    Quote Originally Posted by Webzarus, post: 243729
    Personally, I'd use IP blocks as filters for the legitimate crawlers... It's very easy to make a browser display a user_agent string that mimics a search crawler...

    Sure you can spoof IP addresses, but that usually entails some sort of proxy that can also be detected and filtered. And spoofing without a proxy is difficult for most people.
    As with all verification itīs primarily to inform the visitor that this site contains products that is for grown-ups.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:53 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com