GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   For -Php Guru's- Only (https://gfy.com/showthread.php?t=137288)

pantymaniac 05-26-2003 04:45 PM

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);
}
}
?>

Libertine 05-26-2003 04:55 PM

I could do that in a few secs, but since you only want Guru's helping out, I guess you're screwed.

pantymaniac 05-26-2003 05:05 PM

:( :helpme :)

Nysus 05-26-2003 05:13 PM

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

Cheers,
Matt

Libertine 05-26-2003 05:27 PM

Quote:

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. :glugglug

Icy 05-26-2003 05:31 PM

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.

Libertine 05-26-2003 05:51 PM

Quote:

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?

Icy 05-26-2003 06:03 PM

Quote:

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" ;)

Libertine 05-26-2003 06:05 PM

Quote:

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 :winkwink:


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