WebQuartet Directory philippines Increase Youtube Video Views


Here's the amazing cover letters ==> Amazing Cover Letters
Here's the amazing resume creator ==> Amazing Resume Creator
Guide to Job Interview Answers ==> Job Interview Answers
Secrets to Job Interviews ==> Job Interview Secrets
Best Source For Flexible Jobs ==> Job Search
Increase Your Youtube Video Views

Archive for February, 2008

IP Catching

Saturday, February 16th, 2008

Just for educational purpose. You can limit number of IPs to get your offer or catch thieves on downloading. I don’t know where you will use this but this is simple but powerful.

Here’s the code:

<?php
$v_ip = "$REMOTE_ADDR";

$fd = fopen("visitorIPs.log", "r"); 
$value = "";
while(!feof($fd)){
	$value .= fread($fd, 4096);	
}
fclose($fd);
$value=explode("|",$value);

if (count($value)<300) {

	$result = -1;
	for ($i = 0; $i <= count($value); $i++) {
		if (strcmp($value[$i], $v_ip) == 0) {
			$result = $i;
		}
	}

	if ($result == -1) {
		$file = fopen("visitorIPs.log", "a");
		fputs($file, $v_ip."|", strlen($v_ip."|"));
		fclose($file);

		echo "Congratulations, you made on one of the first 300 limit!";
	} else {		
		echo "Thanks for visiting again!";
	}

} else {

echo "Sorry, the 300 limit is already used! Better luck on the next offer.";

}
 
?>

Save it as .php file.


A Ross Dalangin's Network

WebQuartet Channels is Stephen Fry proof thanks to caching by WP Super Cache