Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Verifying if a source has a script

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    except 1 thing.. for <script is that for javascript?
    Yes. You never specified what sort of script you were talking about, so I naturally assumed the most obvious one.
    and would i be able to change that?
    Unlikely. Server-side scripts are very different from client-side scripts from the point of view of the client (which is what the PHP script would be acting as); you'd need to devise an entirely different method, if it were possible at all.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #12
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    PHP Code:
    <?php
    $affiliate 
    'somesite.com'//Don't add anyhting that isn't ALWAYS in the URL
    if(strpos(strtolower($_SERVER['HTTP_REFERER']),$affiliate) !== false){
    echo 
    'Welcome Affiliate';
    }
    else{
    echo 
    'Welcome Guest';
    }
    ?>
    This should work for both #1 #2 as long as you change somesite.com to the opposite;

  3. #13
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    strpos(strtolower(
    What's wrong with stripos()?

    Relying on HTTP_REFERER (except as a convenience) is dangerous, since a lot of firewalls strip it.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #14
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by Twey
    What's wrong with stripos()?
    The large number of PHP 4 servers
    Quote Originally Posted by Twey
    Relying on HTTP_REFERER (except as a convenience) is dangerous, since a lot of firewalls strip it.
    As long as it is not mission critical I don't see why HTTP_REFERER should not be used. If it has to be one hundred percent accurate then the get variable method I posted a couple posts ago should be used.

  5. #15
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Ah, so 'tis.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #16
    Join Date
    Aug 2006
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks..

    is it possible to only do it once?

    Because i want a script that also includes to another website, and that same script that checks another website.

    and if this wont stop, then it would be an endless loop.
    Last edited by cursed; 08-28-2006 at 07:00 PM.

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
  •