All pastes #476546 Raw Edit

Someone

public php v1 · immutable
·published 2007-05-08 04:49 UTC
rendered paste body
<?// web sites loopfor ($i = 0; $i < count($smap); $i++) {    Echo "Working on Web Site ID #".$smap[$i]['id']."<br>";		$xmlfile1 = "testsitemap-" . $smap[$i]['id'] . "-page1.php";	$xmlfile2 = "testsitemap-" . $smap[$i]['id'] . "-page2.php";	$xmlfile3 = "testsitemap-" . $smap[$i]['id'] . "-page3.php";	$xmlfile4 = "testsitemap-" . $smap[$i]['id'] . "-page4.php";	$xmlfile5 = "testsitemap-" . $smap[$i]['id'] . "-page5.php";	$fh1 = fopen($xmlfile1, 'w') or die("can't open");	$fh2 = fopen($xmlfile2, 'w') or die("can't open");	$fh3 = fopen($xmlfile3, 'w') or die("can't open");	$fh4 = fopen($xmlfile4, 'w') or die("can't open");	$fh5 = fopen($xmlfile5, 'w') or die("can't open");	for ($f = 0; $f < count($smap[$i]['general']); $f++) {			// general links		Echo "Text:".$smap[$i]['general'][$f][0]." Link:".$smap[$i]['general'][$f][1]."<br>";		$stringData .= "<a href=" . $smap[$i]['general'][$f][1] . ">" . $smap[$i]['general'][$f][0] ."</a><br>";		$count++;		if ($count < 100) {				fwrite($fh1, $stringData);				$stringData = '';			}		if ($count == 100) { 			echo "<br>Hit 100<br>";			if ($count > 100) { 				fwrite($fh1, $stringData);				$stringData = '';				fclose($fh1);			}		}		if ($count == 200) { 			echo "<br>Hit 200<br>";			fwrite($fh2, $stringData);			$stringData = '';			fclose($fh2);		}		if ($count == 300) { 			echo "<br>Hit 300<br>";			fwrite($fh3, $stringData);			$stringData = '';			fclose($fh3);		}	}//	echo count($smap[$i]['general']);	for ($g = 0; $g < count($smap[$i]['locations']); $g++) {		// location		Echo "Location:".$smap[$i]['locations'][$g]."<br>";			for ($s = 0; $s < count($smap[$i]['location_links'][$smap[$i]['locations'][$g]]); $s++) {					// location links		Echo "Text:".$smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0]." Link:".$smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][1]."<br>";				$stringData .= "<a href=" . $smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][1] . ">" . $smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0] ."</a><br>";		$count++;		if ($count == 100) { 			echo "<br>Hit 100<br>";			fopen($xmlfile1, 'a') or die("can't open"); 			fwrite($fh1, $stringData);			$stringData = '';			fclose($fh1);		}		if ($count == 200) { 			echo "<br>Hit 200<br>";			fwrite($fh2, $stringData);			$stringData = '';			fclose($fh2);		}		if ($count == 300) { 			echo "<br>Hit 300<br>";			fwrite($fh3, $stringData);			$stringData = '';			fclose($fh3);		}		if ($count == 400) { 			echo "<br>Hit 400<br>";			fwrite($fh4, $stringData);			$stringData = '';			fclose($fh4);		}		if ($count == 500) { 			echo "<br>Hit 500<br>";			fwrite($fh5, $stringData);			$stringData = '';			fclose($fh5);		}	    }	}}	echo $count;?>