Rar! ϐs
t 7 7 pqg@0\ 㭪樮 ਥ I\index.php σ `sF TC;O ՄB0@ρ `
// ()
$nameDB = "blog";//
$nameSERVER = "localhost";//
$nameUSER = "root";//
$passUSER = "";//
mysql_select_db($nameDB, mysql_connect($nameSERVER,$nameUSER,$passUSER));
// ()
//
$header_title = " HTML";
$header_metaD = " ";
$header_metaK = " ";
//GET blog
if(isset($_GET['blog']))
{
$blog = $_GET['blog'];
if(!preg_match("/^[0-9]+$/",$blog))
{
header("location: index.php");
exit;
}
}
//GET blog
//GET contact
if(isset($_GET['contact']))
{
$contact = $_GET['contact'];
if(!preg_match("/^[1-2]?$/",$contact))
{
header("location: index.php");
exit;
}
}
//GET contact
//GET cat
if(isset($_GET['cat']))
{
$cat = $_GET['cat'];
if(!preg_match("/^[0-9]+$/",$cat))
{
header("location: index.php");
exit;
}
}
//GET cat
//
if($contact)//
{//
include("moduls/contact.php");//
$txt = contact($contact);// ,
}
//
//
if(!$blog AND !$contact)//
{
include("moduls/news.php");
$txt = index_page();// ,
}
//
//
if($cat)
{
include("moduls/cat.php");
$txt = index_cat($cat);
}
//
// C
if($blog)
{
include("moduls/text.php");
$txt = blog($blog);// ,
}
// C
//
include("moduls/menu.php");
$menu = menu();// ,
//
//
if($blog)
{
include("moduls/comm.php");
if(!isset($error_comm))$error_comm = "";
$comm = comm($blog,$error_comm);//
$txt .= $comm;
}
//
include("templates/index.html");//
?>t g g $]^jR@0b 㭪樮 ਥ I\moduls\comm.php σ `sF TC;O ՄB0@ρ ` p
//--------------
$date_day = date("d");//
$date_month = date("m");//
$date_year = date("Y");//
$date_time = date("H:i");//
$date_comm = $date_day."/".$date_month."/".$date_year." ".$date_time;//
// // :
//
if(isset($_POST['id_comm']))$id_comm = $_POST['id_comm'];
if(isset($_POST['txt_comm']))$txt_comm = $_POST['txt_comm'];
if(isset($_POST['author_comm']))$author_comm = $_POST['author_comm'];
if(isset($_POST['email_comm']))$email_comm = $_POST['email_comm'];
if(isset($_POST['site_comm']))$site_comm = $_POST['site_comm'];
if(isset($id_comm) & isset($txt_comm) & isset($author_comm))//
{
// html ( ) =)
// , ,
$id_comm = htmlspecialchars($id_comm);
$txt_comm = htmlspecialchars($txt_comm);
// ''
if($author_comm != "" AND $author_comm != "*")//
{
// , , - _
if(!preg_match("/^[-_0-9a-zA-Z-- ]+$/s",$author_comm))$error_comm .= " ''|";
// 25
if(mb_strlen($author_comm) > 25)$error_comm .= " '' |";
}
else $error_comm .= " ''|";//
//
if($txt_comm == "" OR $txt_comm == " *")$error_comm .= " ''|";
//
if($email_comm != "" AND $email_comm != "E-Mail* ( )")//
{
// ( )
if(!preg_match("/^[-_a-zA-Z0-9]+@[-_a-zA-Z0-9]+\.[-_a-zA-Z]+$/s",$email_comm))$error_comm .= " E-mail|";
}
else $error_comm .= " 'E-mail'|";//
//
if($site_comm != "" AND $site_comm != "http://")//
{
// ( )
if(!preg_match("/^http:\/\/[-_a-z-0-9.]+\.[a-z-]+$/s",$site_comm))$error_comm .= " |";
}
else $site_comm = "";// ,
if(!isset($error_comm))
{
//
$id_comm = str_replace("'","'",$id_comm);
$txt_comm = str_replace("'","'",$txt_comm);
$txt_comm = str_replace("\n","
",$txt_comm);//
//
$result_add_comm = mysql_query ("INSERT INTO comm (author,text,date_comm,blog,email,site)
VALUES ('$author_comm','$txt_comm','$date_comm','$id_comm','$email_comm','$site_comm')");
header("location: index.php?blog=$blog#bottom");//
exit;//
}
}
//--------------
function comm($blog,$error)//
{
$result_index = mysql_query("SELECT * FROM comm WHERE blog='$blog' ORDER BY id");// blog ID
$myrow_index = mysql_fetch_array($result_index);
if($myrow_index != "")//
{// ...
$sm_read = file("templates/comm.html");//...
$sm_read = implode("",$sm_read);// file() ,
do// do while
{
$edd_tamp = $sm_read;// ,
// ,
// file() 1 ,
//
//
if($myrow_index[site] != "")$author = "".$myrow_index[author]."";//
else $author = $myrow_index[author];// ,
$edd_tamp = str_replace("[_text]",$myrow_index[text],$edd_tamp);//
$edd_tamp = str_replace("[_author]",$author,$edd_tamp);//
$edd_tamp = str_replace("[_date_b]",$myrow_index[date_comm],$edd_tamp);//
$comm .= $edd_tamp;//
}
while($myrow_index = mysql_fetch_array($result_index));
}
else $comm = "
, =)
";// , $form = file("templates/comm_form.html");// $form = implode("",$form);// file() , // if($error != "")// { $error = explode("|",$error);// $echoERROR .= ":
";// for($i=0;isset($error[$i]);$i++)// { if($error[$i] != "")$echoERROR .= ">$error[$i]
";// } $form = str_replace("[_error]",$echoERROR,$form);// } else $form = str_replace("[_error]","",$form);// , - // $form = str_replace("[_id]",$blog,$form);// id c $comm .= $form; return $comm;// html } ?>"t b@0k 㭪樮 ਥ I\templates\comm_form.html σ `sF TC;O ՄB0@ρ ` [_error] gt~ @0Y 㭪樮 ਥ I\moduls σ `sF TC;O ՄB0@ρ ` {j(t @0\ 㭪樮 ਥ I\templates σ `sF TC;O ՄB0@ρ ` @<9tw @0R 㭪樮 ਥ I σ `sF TC;O ՄB0@ρ ` ϲa={ @