hello all
i have a small problem
i have a .txt file
search.txt
in php
i wanna open the file and read it and then execute it
<?php
$ip = $argv[1];
$page = "http://". $argv[1];
$init=curl_init();
curl_setopt($init,CURLOPT_URL,$page);
curl_setopt($init,CURLOPT_RETURNTRANSFER,1);
curl_setopt($init,CURLOPT_SSL_VERIFYPERR,0);
curl_setopt($init,CURLOPT_TIMEOUT,10);
$data=curl_exec($init);
curl_close($init);
if (strstr($data,"Welcome to the Web")) {
$logs="log.txt";
$getip = "http://" .$argv[1];
$open = fopen($logs , "r+") or die("can`t read");
fputs($open,$getip);
fclose($open);
}else {
echo "error";
}
?>
search.txt
20.20.20.20
10.20.30.20
how do i grab the ip`s one by one from the .txt file
and then just : php search.php search.txt
thanks in advance
its just a question .. just wanna understand how its done