1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | PhpWebGallery - a PHP based picture gallery | |
---|
4 | // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | |
---|
5 | // +-----------------------------------------------------------------------+ |
---|
6 | // | branch : BSF (Best So Far) |
---|
7 | // | file : $Id: qsearch.php 1537 2006-08-15 02:06:06Z rvelices $ |
---|
8 | // | last update : $Date: 2006-08-15 02:06:06 +0000 (Tue, 15 Aug 2006) $ |
---|
9 | // | last modifier : $Author: rvelices $ |
---|
10 | // | revision : $Revision: 1537 $ |
---|
11 | // +-----------------------------------------------------------------------+ |
---|
12 | // | This program is free software; you can redistribute it and/or modify | |
---|
13 | // | it under the terms of the GNU General Public License as published by | |
---|
14 | // | the Free Software Foundation | |
---|
15 | // | | |
---|
16 | // | This program is distributed in the hope that it will be useful, but | |
---|
17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
19 | // | General Public License for more details. | |
---|
20 | // | | |
---|
21 | // | You should have received a copy of the GNU General Public License | |
---|
22 | // | along with this program; if not, write to the Free Software | |
---|
23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
24 | // | USA. | |
---|
25 | // +-----------------------------------------------------------------------+ |
---|
26 | |
---|
27 | define('PHPWG_ROOT_PATH','./'); |
---|
28 | include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); |
---|
29 | |
---|
30 | if (empty($_GET['q'])) |
---|
31 | { |
---|
32 | redirect( make_index_url() ); |
---|
33 | } |
---|
34 | |
---|
35 | $search = array(); |
---|
36 | $search['q']=$_GET['q']; |
---|
37 | |
---|
38 | $query =' |
---|
39 | INSERT INTO '.SEARCH_TABLE.' |
---|
40 | (rules) |
---|
41 | VALUES |
---|
42 | (\''.serialize($search).'\') |
---|
43 | ;'; |
---|
44 | pwg_query($query); |
---|
45 | |
---|
46 | $search_id = mysql_insert_id(); |
---|
47 | |
---|
48 | redirect( |
---|
49 | make_index_url( |
---|
50 | array( |
---|
51 | 'section' => 'search', |
---|
52 | 'search' => $search_id, |
---|
53 | ) |
---|
54 | ) |
---|
55 | ); |
---|
56 | ?> |
---|