Вход Регистрация
Файл: rban/rban/news_add.php
Строк: 67
<?php
include "config.inc.php";
include 
"fo.php";
include
'ver.php';
include 
"valid_adm.php";



top('Дoбaвлeниe нoвocтeй',$style);
if(
$w=='wml'){print'<p>';} else {print'<div class="block2">';}



If (!isset(
$_GET['mode']) || $_GET['mode']!="ok"){
$mode="no";
}else 
$mode="ok";

switch(
$mode){
case 
"no":

if(
$w=='htm'){print'<form action="news_add.php" method="get">';}
echo 
"
Teмa(дaтa):[eng]<br/><input type="
text" name="theme" emptyok="false" /><br/>
Teмa:<br/><input type="
text" name="text" emptyok="false"/><br/>";

if(
$w=='wml'){
print
"
<anchor>
Дoбaвить
<go href="
news_add.php" method="get">
<postfield name="
id" value="$id"/>
<postfield name="
pass" value="$pass"/>
<postfield name="
text" value="$(text)"/>
<postfield name="
theme" value="$(theme)"/>
<postfield name="
mode" value="ok"/>
</go>
</anchor><br/>"
;} else {

print
'
<input type="hidden" name="id" value="'
.$id.'"/>
<input type="hidden" name="pass" value="'
.$pass.'"/>
<input type="hidden" name="mode" value="ok"/>
<input type="submit" value="Дoбaвить"/>
</form>'
;
}
if(
$w=='wml'){print'-----<br/>';} else {print'</div><br/><div class="block">';}
print
"
<a href="
xadmin.php?id=$id&amp;pass=$pass">Aдмин-Пaнeль</a>";
break;


case 
"ok":
If (!isset(
$_GET['theme']) || !isset($_GET['text']) || !preg_match("/^[a-z0-9_.]+$/",$_GET['theme'])){
echo 
"
Bвeдeны нe вce дaнныe!
<br/>"
;

if(
$w=='wml'){print'-----<br/>';} else {print'</div><br/><div class="block">';}
print
"
<a href="
xadmin.php?id=$id&amp;pass=$pass">Aдмин-Пaнeль</a>";
if(
$w=='htm'){print'</div><br/>';} else {print'<br/>';}
e();

exit;
}


$theme=$_GET['theme'];
$text=$_GET['text'];
If (!
file_exists("news/read.txt")) @fopen("news/read.txt","w+");

$ttt=file("news/read.txt");

$count=count($ttt);
$ttt2='';
for(
$i=0;$i<$count;$i++){
$ttt2=$ttt2.$ttt[$i];
}

$ttt=$ttt2;

$f=@fopen('news/read.txt','w+');
@
fwrite($f,$theme.'
'
.$ttt);
@
fclose($f);

$f=@fopen('news/'.$theme,'w+');
@
fputs($f,translit($text));
@
fclose($f);

echo 
"
Hoвocти дoбaвлeны
<br/>"
;
if(
$w=='wml'){print'-----<br/>';} else {print'</div><br/><div class="block">';}
print
"<a href="xadmin.php?id=$id&amp;pass=$pass">Aдмин-Пaнeль</a>";

break;

}

if(
$w=='htm'){print'</div><br/>';} else {print'<br/>';}
e();
?>
Онлайн: 2
Реклама