![]() |
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); } } ?> |
I could do that in a few secs, but since you only want Guru's helping out, I guess you're screwed.
|
:( :helpme :)
|
Just put a foreach that goes through an array of URLs, around the other foreach.
Cheers, Matt |
Quote:
|
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. |
Quote:
|
Quote:
|
Quote:
|
| All times are GMT -7. The time now is 12:44 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123