Размер файла: 6.65Kb
<?
include ("config.php");
if ($login==="$adminlogin" && $pass==="$adminpass"){
$addtime= time ();
$newsadd="INSERT into news (title, news, addtime, addnick) VALUES ('$title', '$addnews', '$addtime', '$addnick')";
?>
<? if ($version=="html"){ echo "<html>
<head ('Content-type: text/vnd.wap.wml');>
<title>Новости $homesite</title>
<style type='text/css'>
.top
{
border-top: solid 3px #000000;
background-color: #FFFF00;
border-bottom: solid 3px #CCCCCC;
}
.cov
{
padding-left: 4px;
padding-top: 2px;
padding-bottom: 4px;
border-top: solid 1px #CCCCCC;
}
.news
{
background-color: #009900;
border-top: solid 1px #FFFFFF;
border-bottom: solid 1px #FFFFFF;
color: #FFFFFF;
padding: 3px;
}
.dwap
{
background-color: #FFFF99;
border-top: solid 1px #000000;
border-bottom: solid 1px #000000;
color: #333333;
padding: 3px;
}
.btm
{
background-color: #BBBBBB;
border-top: solid 1px #999999;
color: #FFFFFF;
padding: 3px;
}
.atation
{
color: #FF0000;
text-decoration: underline;
}
</style>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<meta http-equiv='Cache-Control' content='no-cache' forua='true'/>
</head>
<body>";} else {header("Content-type:text/vnd.wap.wml");
echo "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml1.2.dtd\">\n
<wml>
<card id=\"\" title=\"Новости $homesite\">";}?>
<?if ($version=="html"){echo "<div class='cov' align='center'>";} else { echo "<p align='center'><small>";}?> <img src="http://dwap.tj/images/dwap_logo.gif"/><br/>
http://dwap.tj
<?if ($version=="html"){echo "</div>";} else {echo "</small></p>";}?>
<p>
Добавка новостей:<br/>
<?
if($Submit!="" || $addnewnews=="1"){
$q=mysql_query ("Select * from news where news='$addnews'");
if (mysql_num_rows($q)>0) {echo "Новость была добавлена<br/>"; } else {
if (!mysql_query ($newsadd)){
echo "Ошибка базы данных<br/>";} echo "Новость успешно добавлена<br/>";}}
?>
<?if ($version=="html"){echo "<div class='top' align='center'></div>";} else {echo "<small>";} ?>
<?
if ($version=="html"){ echo "<div class='news'>";}?>
<?if ($version=="html"){ echo "<form name='form1' method='post' action=''>";}?>
Тема:
<input type='text' name='title' value='' size='10'/>
<br/>
Новость:
<input type='text' name='addnews' value='' size='20'/>
<br/>
<?if ($version=="html"){ echo "<input type='submit' name='Submit' value='Добавить'> </form>";} else {?>
<anchor title="Submit">Добавить<go href="add.php">
<postfield name="addnewnews" value="1"/>
<postfield name="title" value="$title"/>
<postfield name="addnews" value="$addnews"/>
<postfield name="login" value="<? echo $login; ?>"/>
<postfield name="pass" value="<? echo $pass;?>"/> </go> </anchor> <br/>
<?} if ($version=="html"){ echo "</div>";} else ?>
<small> <br/>
<?if ($version=="html"){echo "<div class='btm'>[<a href='?version=wap&login=$login&pass=$pass'>wap</a> | html] <br/> <a href='index.php?version=html'>Новости</a>";} else {echo "[wap | <a href='?version=html&login=$login&pass=$pass'>html</a>] <br/> <a href='index.php?version=wap'>Новости</a>";} ?>
<br/>
© <a href="<?echo $homeurl?>"><?echo $homesite?></a> , 2006-2007 <br/>
</small>
<?if ($version=="html"){echo "</div> ";} else {echo"</small>";} ?>
</p>
<? if ($version=="html"){ echo "</body></html>";} else {echo "</card></wml>";}}
else
{
if ($version=="html"){ echo "<html>
<head ('Content-type: text/vnd.wap.wml');>
<title>Новости $homesite</title>
<style type='text/css'>
.top
{
border-top: solid 3px #000000;
background-color: #FFFF00;
border-bottom: solid 3px #CCCCCC;
}
.cov
{
padding-left: 4px;
padding-top: 2px;
padding-bottom: 4px;
border-top: solid 1px #CCCCCC;
}
.news
{
background-color: #009900;
border-top: solid 1px #FFFFFF;
border-bottom: solid 1px #FFFFFF;
color: #FFFFFF;
padding: 3px;
}
.dwap
{
background-color: #FFFF99;
border-top: solid 1px #000000;
border-bottom: solid 1px #000000;
color: #333333;
padding: 3px;
}
.btm
{
background-color: #BBBBBB;
border-top: solid 1px #999999;
color: #FFFFFF;
padding: 3px;
}
.atation
{
color: #FF0000;
text-decoration: underline;
}
</style>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<meta http-equiv='Cache-Control' content='no-cache' forua='true'/>
</head>
<body>";} else {header("Content-type:text/vnd.wap.wml");
echo "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml1.2.dtd\">\n
<wml>
<card id=\"\" title=\"Новости $homesite\">";}?>
<?if ($version=="html"){echo "<div class='cov' align='center'>";} else { echo "<p align='center'><small>";}?> <img src="http://dwap.tj/images/dwap_logo.gif"/><br/>
http://dwap.tj
<?if ($version=="html"){echo "</div>";} else {echo "</small></p>";}?>
<p>
Введите логин и пароль: <br/>
<?if ($version=="html"){echo "<div class='top' align='center'></div>";} else {echo "<small>";} ?>
<?
if ($version=="html"){ echo "<div class='news'>";}?>
<?if ($version=="html"){ echo "<form name='form1' method='post' action='add.php'>";}?>
Логин:
<input type='text' name='login' value='' size='10'/>
<br/>
Пароль:
<input type='text' name='pass' value='' size='20'/>
<br/>
<?if ($version=="html"){ echo "<input type='submit' name='Submit5' value='Вход'> </form>";} else {?>
<anchor title="Submit">Вход<go href="add.php">
<postfield name="login" value="$login"/>
<postfield name="pass" value="$pass"/>
</go> </anchor> <br/>
<?} if ($version=="html"){ echo "</div>";} else ?>
<small> <br/>
<?if ($version=="html"){echo "<div class='btm'>[<a href='?version=wap&login=$login&pass=$pass'>wap</a> | html] <br/> <a href='index.php?version=html'>Новости</a>";} else {echo "[wap | <a href='?version=html&login=$login&pass=$pass'>html</a>] <br/> <a href='index.php?version=wap'>Новости</a>";} ?>
<br/>
© <a href="<?echo $homeurl?>"><?echo $homesite?></a> , 2006-2007 <br/>
</small>
<?if ($version=="html"){echo "</div> ";} else {echo"</small>";} ?>
</p>
<? if ($version=="html"){ echo "</body></html>";} else {echo "</card></wml>";}
}?>