HEX
Server: Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 mod_fcgid/2.3.9 PHP/5.4.16
System: Linux dvm.vladweb.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: region-gk.ru (1016)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: //home/bk/efi/eficenter.ru/old/admin_news_editandanswere.php
<?
include("cfg/connect.inc.php");
	include("cfg/mysql.php");
	include("cfg/general.inc.php");
	include("cfg/lang.inc.php");
	include("cfg/functions.php");
require 'smarty/Smarty.class.php'; 

//connect to database
	db_connect(DB_HOST,DB_USER,DB_PASS) or die (db_error());
	db_select_db(DB_NAME) or die (db_error());

	$smarty = new Smarty; //core smarty object
	$smarty_mail = new Smarty; //for e-mails

//authorized login check
	
	session_start();
	include("./checklogin.php");
	if (!isset($_SESSION["login"]) || strcmp($_SESSION["login"],ROOT_LOGIN)) //unauthorized
	{
		die ("You are not authorized to view this page");
	}

$smarty->template_dir = $template_path."/admin";
	$smarty_mail->template_dir = $template_path."/mail";
if(isset($N_EDT))
{
   $QA="SELECT * FROM news WHERE n_id={$N_EDT} " ;
$res=mysql_query($QA) or DIE ("SELECT * FROM news ERROR! ".MYSQL_ERROR());

	$rowa=mysql_fetch_array($res) ;

$smarty->assign("row", $rowa);
$smarty->display($template_path."admin/admin_news_basic_index.tpl");
}   ;

if(isset($N_EDT)&&isset($save_mess_n)&&$save_mess_n="1")
{$title=validate_search_string($title);
$bigtext=validate_search_string($bigtext);
$smalltext=validate_search_string($smalltext);

 $Query="UPDATE news SET n_title='$title', n_smalltext='$smalltext', n_bigtext='$bigtext'   WHERE n_id='$N_EDT'";
 mysql_query($Query) or DIE ("UPDATE * FROM news ERROR! ".MYSQL_ERROR());
//close window
				echo "<script>\n";
				echo "window.opener.location.reload();\n";
				echo "window.close();\n";
				echo "</script>\n</body>\n</html>";
				exit;
				
};


?>