PHP Check if GET parameter is in .txt file and return a response yes/no -


i'm new php wanted know how make script have put parameter (index.php?test=value) , checks value in txt file provided. if value exists print yes if no print no, if there isn't parameter print ''empty''. please me how this.

$_get['test'] = 'value'; if(empty($_get['test'])) {     echo 'empty'; } else {     $file ='asdfasdfasvalue';     if(strpos($file, $_get['test'])) {         echo 'yes';     } else {         echo 'no';     } } 

you should populate $file file's contents.

functions being used...
http://php.net/manual/en/function.empty.php
http://php.net/strpos
http://php.net/manual/en/function.file-get-contents.php


Comments