File size: 3.87Kb
<?
include ("config.php");
$date= time ();
$newcomment="INSERT into newscomments (newsid, nick, com, date) VALUES ('$newsid', '$nick', '$com', '$date')";
?>
<? 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!="" || $addnewcommnet=="1"){
$q=mysql_query ("Select * from newscomments where com='$com'");
if (mysql_num_rows($q)>0 || $nick=="" || $nick==" " || $com=="" || $com==" ") {echo "Спамить запрещено<br/>"; } else {
if (!mysql_query ($newcomment)){
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='nick' value='' size='10'/>
<br/>
Коментарии:
<input type='text' name='com' value='' size='20'/>
<br/>
<?if ($version=="html"){ echo "<input type='submit' name='Submit' value='Добавить'> </form>";} else {?>
<anchor title="Submit">Добавить<go href="addcomment.php">
<postfield name="addnewcomment" value="1"/>
<postfield name="nick" value="$nick"/>
<postfield name="com" value="$com"/>
<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&newsid=$newsid&login=$login&pass=$pass'>wap</a> | html]";} else {echo "[wap | <a href='?version=html&newsid=$newsid&login=$login&pass=$pass'>html</a>]";} ?><br/>
<br/>
< -<? echo "<a href='comment.php?version=$version&newsid=$newsid&login=$login&pass=$pass'>Коментарии</a>";?><br/>
<- <? echo "<a href='index.php?version=$version&login=$login&pass=$pass'>Новости</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>";}
?>