Exemplo n.º 1
0
function mysqlcon() {
	global $db_host, $db_user, $db_pass, $db_name, $db_charset;
	if (!@mysql_connect($db_host, $db_user, $db_pass))
		die(m_error(mysql_error()));
mysql_select_db($db_name);
mysql_query("SET NAMES "._filter($db_charset)."");
}
function m_query($p_statement)
{
    //--- Execute the Statement
    $result = "";
    if (!($result = mysql_query($p_statement))) {
        $err_msg = "Error in selecting database\n";
        $err_msg .= sprintf("\terror:%d\t\nerror message %s\n", mysql_errno(), mysql_error());
        $err_msg .= sprintf("\tsql: %s", $p_statement);
        echo m_error($err_msg);
        exit;
    }
    return $result;
}
Exemplo n.º 3
0
 <? exit;}}
else{
	echo "hi";
}
$rand = ('#<page>(.*?)</page>#is'); //(.*?) - рандомное значение
preg_match_all($rand,$open,$out); 
for($i = 0; $i < count($out[1]); $i++) 
{$up1 = "".$out[1][$i]."";} 
$up8 = $up1.$up8;
if($up8 == 1 || $up8 == 2)
{
	
$q2 = mysql_query("DELETE FROM pages WHERE mod_id = '"._filter($idt)."'")or die(m_error(mysql_error()));
if ($q2 == 'true')
{
}else { ?><?php 
echo $errorlang;
?>
 <? exit;}}
else{
	echo "hi";
}

$delete = mysql_query("DELETE FROM modules WHERE id = '"._filter($idt)."'")or die(m_error(mysql_error()));
if ($delete == 'true')
{?>
Модуль удалён!<? exit; }else { ?><?php 
echo $errorlang;
?>
 <? exit;}
?>
Exemplo n.º 4
0
$name = htmlspecialchars($_POST['name']);
$name = iconv( "utf-8", "windows-1251", $name);
$text = $_POST['text'];
$text = iconv( "utf-8", "windows-1251", $text);
$page = $_POST['page'];
$page = iconv( "utf-8", "windows-1251", $page);

$rusname = rus2translit($name); 

$rusname = strtolower($rusname); 

$date = time();
$proverka = mysql_query("SELECT * FROM pages WHERE page='"._filter($page)."'");
if(mysql_num_rows($proverka) >= 1)
{
m_error("Такая страница уже существует");
exit;
}
$send = mysql_query("INSERT INTO pages VALUES(NULL,'"._filter($name)."','"._filter2($text)."','"._filter($date)."','"._filter($page)."', '0')");

if ($send == 'true')
{
?>
Страница добавлена!
<?
exit;
}

else 

{
Exemplo n.º 5
0
include getenv("DOCUMENT_ROOT") . "/include/functions.php";
include getenv("DOCUMENT_ROOT") . "/lang/russian.php";
mysqlcon();
include "chklogin.php";
$pagename = $adminlang['edituser'];
require "adminskin/head.php";
if (!empty($_POST['name'])) {
    if (empty($_POST['name']) || empty($_POST['new']) || empty($_POST['old'])) {
        die("<br><h2>" . $adminlang['edituser'] . "</h2><br>" . $adminlang['addcat_empty']);
    }
    $name = htmlspecialchars($_POST['namenew']);
    $pass = htmlspecialchars($_POST['new']);
    $passold = htmlspecialchars($_POST['old']);
    $passold = md5($passold);
    $pass = md5($pass);
    $query = mysql_query("SELECT * FROM users WHERE login = '******' AND password = '******' ") or die(m_error(mysql_error()));
    if (mysql_num_rows($query) == 1) {
        $rower = mysql_fetch_array($query);
        $id = $rower['id'];
        $send = mysql_query("UPDATE users SET  login = '******', password='******' WHERE id='" . _filter($id) . "'");
        if ($send == 'true') {
            print '<br><h2>' . $adminlang['edituser'] . '</h2><br>' . $adminlang['edituser_suc'];
            unset($_SESSION['admin_id']);
            die;
        }
    }
}
?>
    <div id="rightside">
            <div class="headings alt">
                <h2><?php 
Exemplo n.º 6
0
$frompage =  $config[10];
$host = $config[11];
if($nw == 1)
{
session_start();

if (!isset($_SESSION['admin_id'])) {

    if (isset($_COOKIE['minibo_login']) && isset($_COOKIE['minibo_password'])) {

        $login = mysql_real_escape_string($_COOKIE['minibo_login']);
        $password = mysql_real_escape_string($_COOKIE['minibo_password']);



        $query = mysql_query("SELECT id FROM users WHERE login='******' AND password='******' LIMIT 1") or die(m_error(mysql_error()));
	

    if (mysql_num_rows($query) == 1) {
     

        $sqlrow = mysql_fetch_array($query);
        $_SESSION['admin_id'] = $sqlrow['id'];


           
        }
        else {

        }
    }
Exemplo n.º 7
0

$date = date('Y-m-d H:i:s', $date);

mysql_query("INSERT INTO `config` (`id`, `name`, `value`) VALUES
(1, 'theme', 'lcms'),
(2, 'sitename', 'Light Cms'),
(3, 'siteslogan', 'Тест)))'),
(4, 'posts_num', '10'),
(5, 'cutpostcount', '1000'),
(6, 'cmsname', 'Light CMS'),
(7, 'curcmsver', '0.5.0 RC2'),
(8, 'mail', '"._filter($mail)."'),
(9, 'aupdate', '"._filter($au)."'),
(10, 'notworking', '0'),
(11, 'sp', '')") or die(m_error(mysql_error()));
?>
            <script>
			location="index.php";
document.location.href="index.php";
window.location.reload("index.php");
document.location.replace("index.php");
</script>
<?
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Light CMS - Установка</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />