Hi All,

I am having a problem getting the value of a variable in a query string from my PHP files....based on php rules everything should be working fine, but for unknown reason to me I simply can't get the query string variable value.

So I will appreciate it so much if someone can please help me find out what is exactly wrong

On a minor note, I am using smarty template engine + Apache mod_rewrite.


search_box.tpl
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<form name="frmsearch" id="frmsearch" method ="get" >
<td>
<input type="text" name="searchterm" value=""/>
</td>
<td>
<input type="submit" value="Search"/>
</td>
</form>
</tr>
</table>


index.php

//I tried once....

if($searchterm)
{ echo $searchterm;
echo 'found it';
}
else
{ echo $_REQUEST['searchterm'];
echo 'Error';
}
exit;

//Then tried ....

if($_GET['searchterm'])
{ echo $searchterm;
echo 'found it';
}
else
{ echo $_REQUEST['searchterm'];
echo 'Error';
}
exit;


//Then tried ....

if($_REQUEST['searchterm'])
{ echo $searchterm;
echo 'found it';
}
else
{ echo 'Error';
}
exit;


And they all gave the same result...show the text Error

On a minor note, I am using Apach mod_rewrite as follows
RewriteRule ^(.*)-LD-([0-9]+)-P([0-9]+)\.html$ index.php?id=$2&cat=$1&page=$3 [L]

And search_box.tpl appear in a URL
http://....../Category-12-LD-5.html

TO

http://....../Category-12-LD-5.html?searcterm=hello world


That is all the info I have...

Thanks in advance for your help and cooperation