-
Notifications
You must be signed in to change notification settings - Fork 0
/
textread.php
54 lines (47 loc) · 1.02 KB
/
textread.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* @author haseeb@brokergenius.com
* @copyright 2016
*/
include('C:\wamp\www\sms.php');
$myfile = fopen("C:\wamp\www\Server\Pinglog.txt", "r");
$message = null;
$messageNew = null;
$defect = null;
while (!feof($myfile))
{
$arrM = fgets($myfile);
$var = test_input($arrM);
$sixe = strlen($var);
if ($sixe >= 53)
{
$arr = explode(",", $var);
if (sizeof($arr) == 4)
{
$res = explode(" ", $var1);
$defect = chop($res[3], ":");
$message = "For IP: " . $defect . "\n Result is: [" . $var . "] \n";
$messageNew .= $message;
}
}
$var1 = $var;
}
//echo $messageNew;
$sms=str_split($messageNew, 3100 );
$num = sizeof($sms);
//echo $num;
//var_dump($sms);
for($i=0;$i<$num;$i++)
{
echo $sms[$i]."<br /><br /><br />";
//sendmessage($sms[$i]);
}
//sendmessage($messageNew);
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>