This topic is locked

ctlSearchfor variable

11/26/2007 6:21:17 PM
PHPRunner General questions
S
stones001 author

Hello,

I would like to record all keywords used in the basic search option in a table named logdata including a field named keyword.

I've creaed a new event called "Insert a record into another table" then filled this event with the following code:
global $conn;

$strSQLInsert = "insert into logdata (keyword) values (????)";

db_exec($strSQLInsert,$conn);
What is the name of the variable containing the user request ?

Any help would be appreciated....
Kind regards,

stones001

Alexey admin 11/27/2007

Hi,
use $_REQUEST["SearchFor"] variable for this.

global $conn;

if(@$_REQUEST["SearchFor"]!="")

{

$strSQLInsert = "insert into logdata (keyword) values ('".db_addslashes($_REQUEST["SearchFor"])."')";

db_exec($strSQLInsert,$conn);

}

S
stones001 author 11/27/2007

Hi,

use $_REQUEST["SearchFor"] variable for this.


Thanks so much...

It works fine :-)

All my best,

stones001