File "db_exec.php"

Full path: /home/argothem/www/memo/site/site/CoolForum_0.8.4_beta/CoolForum_0.8.4_beta/admin/db_exec.php
File size: 3.22 KB
MIME-type: text/x-php
Charset: 8 bit

<?
//*********************************************************************************
//*                                                                               *
//*                  CoolForum v.0.8 Beta : Forum de discussion                   *
//*              Copyright 2001-2002 SORIANO Denis alias Cool Coyote             *
//*                                                                               *
//*                                                                               *
//*       This program is free software; you can redistribute it and/or           *
//*       modify it under the terms of the GNU General Public License             *
//*       as published by the Free Software Foundation; either version 2          *
//*       of the License, or (at your option) any later version.                  *
//*                                                                               *
//*       This program is distributed in the hope that it will be useful,         *
//*       but WITHOUT ANY WARRANTY; without even the implied warranty of          *
//*       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
//*       GNU General Public License for more details.                            *
//*                                                                               *
//*       You should have received a copy of the GNU General Public License       *
//*       along with this program; if not, write to the Free Software             *
//*	      Foundation, Inc., 59 Temple Place - Suite 330,                          *
//*	      Boston, MA  02111-1307, USA.                                            *
//*                                                                               *
//*                                                                               *
//*       Forum Cr par SORIANO Denis (Cool Coyote)                              *
//*       contact : coyote@coolcoyote.net                                         *
//*       site web et tlchargement : http://www.coolforum.net                   *
//*                                                                               *
//*********************************************************************************

require("entete.php");
getlangage("adm_db_exec");

$tpl->box['resultrequest'] = NULLSTR;

if($_REQUEST['action']=="exec")
{
	if(get_magic_quotes_gpc() == 1)
		$request = stripslashes($_POST['request']);
	else
		$request = $_POST['request'];
	
	$query = $sql->query($request);
	
	$TheRequest = getformatmsg($request);
	if($query)
	{
		if(eregi("INSERT",$request) || eregi("UPDATE",$request) || eregi("DELETE",$request))
			$NbLgnChange = mysql_affected_rows();
		elseif(eregi("SELECT",$request))
			$NbLgnChange = mysql_num_rows($query);
		else
			$NbLgnChange = 0;
		$request = "";
		$tpl->box['resultrequest'] = $tpl->gettemplate("adm_db_exec","sqlok");
	}
	else
	{
		$errnumber = mysql_errno();
		$errphrase = mysql_error();
		
		$tpl->box['resultrequest'] = $tpl->gettemplate("adm_db_exec","sqlnok");
	}
	$_REQUEST['action'] = NULLSTR;;
}

if(empty($_REQUEST['action']))
{
	$tpl->box['admcontent']=$tpl->gettemplate("adm_db_exec","formsql");	
}

$cache.=$tpl->gettemplate("adm_db_exec","content");
require("bas.php");
?>