I'm not sure where is my problem. I've a script called with parameters (GET) like :
http://www.xxx.com?isms_restemsg=STOP&value=1
Here is my code :
$keyword_allowed = array("STOP", "");
$found_keyword = "N";
$keyword_cf = "";
for($i=0; $i < 2; $i++)
{
if (eregi($keyword_allowed[$i], $_GET["isms_restemsg"]))
{
$found_keyword = "Y";
$keyword_cf = $keyword_allowed[$i];
}
}
QUESTION : what happend when the url invoked is :
http://www.xxx.com?isms_restemsg=&value=1
In this case, what happend at the eregi instruction.
I'm asking this question because the $found_keyword="N", it should be "Y" Or is there an error ?
If yes can you help me ?
You shouldn't use
eregi()
, since it's deprecated.It doesn't even look as if you need regular expressions after all.
Give it a try with
stristr()
or even simple compare syntax:(If you write this yourself you probably have control over the GET values as well.)
You can help yourself in such cases by echoing some debug output: