For -Php Guru's- Only

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pantymaniac
    Confirmed User
    • Feb 2003
    • 1192

    #1

    For -Php Guru's- Only

    someone on anotner board wrote this php script to check if someone cheat galleries by language of browser
    so how to modify that to check multiple (100) galleries same time ?

    PHP:--------------------------------------------------------------------------------
    <?php
    if ($_GET["url"]) {
    $lang = array("da","nl","es","de","en","fr","ko","zh");
    echo "<font size=4><b>Testing $_GET[url] ..........</b></font><br><br>\n\n";
    foreach ($lang as $l) {
    echo "<b>Testing url with Accept-Language \"$l\":</b><br>\n";
    echo hit_it($_GET["url"],$l);
    }
    }

    function hit_it($url, $lang) {
    $parsed = parse_url($url);
    $fp = fsockopen ($parsed["host"], 80, $errno, $errstr, 5);
    if (!$fp) { $return = "$errstr ($errno)"; }
    else {
    fputs ($fp, "HEAD $parsed[path] HTTP/1.0\r\nHost: $parsed[host]\r\nAccept-Language: $lang\r\nUser-Agent: Mozilla/4.0\r\n\r\n");
    while(!feof($fp)) { $return .= fgets ($fp,128) . "<br>\n"; }
    return $return;
    fclose ($fp);
    }
    }
    ?>
    This place is for RENT
  • Libertine
    sex dwarf
    • May 2002
    • 17860

    #2
    I could do that in a few secs, but since you only want Guru's helping out, I guess you're screwed.
    /(bb|[^b]{2})/

    Comment

    • pantymaniac
      Confirmed User
      • Feb 2003
      • 1192

      #3
      This place is for RENT

      Comment

      • Nysus
        Confirmed User
        • Aug 2001
        • 7817

        #4
        Just put a foreach that goes through an array of URLs, around the other foreach.

        Cheers,
        Matt
        What name is pr0 / Untouched Markets using these days? Untouched Markets - pr0 - Refund My Money Now

        Someone owes me $2,000 because they didn't do any work that was paid for *pointing at pr0 / William / UntouchedMarkets*

        See http://www.gfy.com/showthread.php?p=16744521 and for more detailed see http://www.gfy.com/showthread.php?t=948645

        Comment

        • Libertine
          sex dwarf
          • May 2002
          • 17860

          #5
          Originally posted by Nysus
          Just put a foreach that goes through an array of URLs, around the other foreach.

          Cheers,
          Matt
          Ofcourse, the script will probably time out with normal settings, so something should be done to prevent that from happening.
          /(bb|[^b]{2})/

          Comment

          • Icy
            Confirmed User
            • Mar 2002
            • 864

            #6
            Put the url's on a mysql database or an array and set a bucle to go throught the whole amount of url's. Asign each result to the url variable and check it for each language. Easy to code but it will take some time to you to add the 100 url's to te database or array unless you already have them added.
            I only see the utility of this into an already codded tgp software, to check each galery when submitted as it checks for banned words etc, but not as standalone script.
            Kimia: Make money with mobile traffic, both adult and mainstream
            Skype: sinlords - ICQ: 83-235-881 email: ivan at kimia.mobi

            Comment

            • Libertine
              sex dwarf
              • May 2002
              • 17860

              #7
              Originally posted by Icy
              Easy to code but it will take some time to you to add the 100 url's to te database or array unless you already have them added.
              He probably has the urls somewhere (txt file, html file, whatever), so getting them into an array (or database, if you prefer that) is a matter of some very simple code. Why type them in yourself when computers are so much better at stuff like that?
              /(bb|[^b]{2})/

              Comment

              • Icy
                Confirmed User
                • Mar 2002
                • 864

                #8
                Originally posted by punkworld


                He probably has the urls somewhere (txt file, html file, whatever), so getting them into an array (or database, if you prefer that) is a matter of some very simple code. Why type them in yourself when computers are so much better at stuff like that?
                That's why i said "unless you already have them added" ;)
                Kimia: Make money with mobile traffic, both adult and mainstream
                Skype: sinlords - ICQ: 83-235-881 email: ivan at kimia.mobi

                Comment

                • Libertine
                  sex dwarf
                  • May 2002
                  • 17860

                  #9
                  Originally posted by Icy


                  That's why i said "unless you already have them added" ;)
                  Well, not many other options, assuming he doesn't know them by heart
                  /(bb|[^b]{2})/

                  Comment

                  Working...