I'm trying to see if a file contains a string that is sent to the page. I'm not sure what is wrong with this code:
?php
$valid = FALSE;
$id = $_GET['id'];
$file = './uuids.txt';
$handle = fopen($file, "r");
if ($handle) {
// Read file line-by-line
while (($buffer = fgets($handle)) !== false) {
if (strpos($buffer, $id) === false)
$valid = TRUE;
}
}
fclose($handle);
if($valid) {
do stufff
}
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…