"; echo "parent.location.href = 'login.html';"; echo ""; }else{ //ログイン //認証CSV $fileName = "public_tbl.csv"; //CSVオープン $file = fopen($fileName,"r"); $rowCnt = sizeof(file($fileName)); //CSV読み込み $cnt=0; $flg=0; while(!feof($file)){ //最終行時抜ける if($cnt == $rowCnt){ break; } //ヘッダは飛ばす $csv = fgets($file); if($cnt == 0){ $cnt++; continue; } //行分割 $str[$cnt] = explode(",", $csv); if($_SESSION["sUserId"] === $str[$cnt][0] and $_SESSION["sPswd"] === $str[$cnt][1]){ //認証OK $flg=1; //$_POST["mode"]=$str[$cnt][2]; //$mode=$str[$cnt][2]; $_SESSION["mode"] = $str[$cnt][2]; break; } $cnt++; } fclose($file); if($flg==0){ //認証NG echo ""; } } ?>