File "recv.php"

Full path: /www/beacon/recv.php
File size: 1.25 KiB (1282 bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Back

<?php
// ===============================================
// 送信データの取得
// ===============================================
extract($_GET);
$mid = $_GET["id"];
$rssi = $_GET["rssi"];
$ap = $_GET["ap"];
$ip = $_GET["ip"];

if((!strcmp("WLAN2", $ap)) ||  (!strcmp("WLAN5", $ap)))
{
	$ap = "WLAN";
}

if((!strcmp("penta01", $ap)) ||  (!strcmp("penta02", $ap)))
{
	$ap = "penta01";
}


$ap_split = explode("_", $ap);
//$const_name = $ap_split[0];
$const_name = "3F";

$SavePath = "/www/beacon/data/" .$const_name;
 
//現場ごとのフォルダ確認・作成
if(!file_exists($SavePath))
{
	mkdir($SavePath, 0777);
    chmod($SavePath, 0777);
}

$now_date = date("Y-m-d H:i:s" ,time());
//$DirPath = "/www/beacon/data.txt";
$DirPath = $SavePath ."/" .$ip .".txt";
//$DirPath_all = $SavePath ."/" ."data.txt";
$DirPath_all = $SavePath ."/" .date("Ymd",time()) .".txt";;

$fp = fopen($DirPath_all,"a");
//fwrite($fp, $now_date ."," .$mid ."," .$rssi ."," .$ap  ."," .$ip ."\n");
fwrite($fp, $now_date ."," .$ap  ."," .$ip .","  .$mid ."," .$rssi ."\n");
fclose($fp);

/*
$fp2 = fopen($DirPath_all,"a");
//fwrite($fp, $now_date ."," .$mid ."," .$rssi ."," .$ap  ."," .$ip ."\n");
fwrite($fp2, $now_date ."," .$ap  ."," .$ip .","  .$mid ."," .$rssi ."\n");
fclose($fp2);
*/
?>

PHP File Manager