source: trunk/qsearch.php @ 1884

Last change on this file since 1884 was 1850, checked in by rvelices, 18 years ago
  • change the way confguest_access is handled so that web services work correctly (and also nbm.php and feed.php)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
5// +-----------------------------------------------------------------------+
6// | file          : $Id: qsearch.php 1850 2007-02-22 05:31:08Z rvelices $
7// | last update   : $Date: 2007-02-22 05:31:08 +0000 (Thu, 22 Feb 2007) $
8// | last modifier : $Author: rvelices $
9// | revision      : $Revision: 1850 $
10// +-----------------------------------------------------------------------+
11// | This program is free software; you can redistribute it and/or modify  |
12// | it under the terms of the GNU General Public License as published by  |
13// | the Free Software Foundation                                          |
14// |                                                                       |
15// | This program is distributed in the hope that it will be useful, but   |
16// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
17// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
18// | General Public License for more details.                              |
19// |                                                                       |
20// | You should have received a copy of the GNU General Public License     |
21// | along with this program; if not, write to the Free Software           |
22// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
23// | USA.                                                                  |
24// +-----------------------------------------------------------------------+
25
26define('PHPWG_ROOT_PATH','./');
27include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
28
29// +-----------------------------------------------------------------------+
30// | Check Access and exit when user status is not ok                      |
31// +-----------------------------------------------------------------------+
32check_status(ACCESS_GUEST);
33
34if (empty($_GET['q']))
35{
36  redirect( make_index_url() );
37}
38
39$search = array();
40$search['q']=$_GET['q'];
41
42$query ='
43INSERT INTO '.SEARCH_TABLE.'
44  (rules, last_seen)
45  VALUES
46  (\''.serialize($search).'\', NOW() )
47;';
48pwg_query($query);
49
50$search_id = mysql_insert_id();
51
52redirect(
53  make_index_url(
54    array(
55      'section' => 'search',
56      'search'  => $search_id,
57      )
58    )
59  );
60?>
Note: See TracBrowser for help on using the repository browser.