View file load/new_com.php

File size: 1.77Kb
<?php
//////////////////////////////////
include('func/format.php');
include('conf.php');
//////////////////////////////////
if(!IsSet($pg) || $pg<1) $pg=1;
$pg=$pg+0;
$page['end'] = $page_kol*$pg;
$page['men'] = $page_kol-1;
$page['begin'] = $page['end']-$page['men'];
$page['next'] = $pg+1;
$page['back'] = $pg-1;


if(IsSet($f) && (file_exists($f)))
{
  
  if(IsSet($name) && IsSet($comment) && $name!='' && $comment!='')
  {
    $file = fopen($f.'.cmt',"a+");
    flock($file,LOCK_EX);
    fwrite($file,htmlspecialchars($name).'[:>]'.htmlspecialchars($comment)."\r\n");
    flock($file,LOCK_UN);
    fclose($file);
    header("Location: ./com.php?f=$f&ver=$ver");
  }
  else
  {
    include('verh.php');
    if($ver=='html') print '<form action='.$SCRIPT_NAME.' method="post">
				Имя:<br/><input name="name" maxlength="20"/><br/>
				Комментарий:<br/><input name="comment" maxlength="100"/><br/>
				<input name="f" value="'.$f.'" type="hidden"/>
				<input name="ver" value="'.$ver.'" type="hidden"/>
				<input value="Добавить" type="submit">
				</form><br/>';
    if($ver=='wml') print 'Имя:<br/><input name="name" size="3" maxlength="20" emtyok="false"/><br/>
				Комментарий:<br/><input name="comment" maxlength="100" emtyok="false"/><br/>
				<anchor>Добавить<postfield name="name" value="$(name)"/>
				<postfield name="comment" value="$(comment)"/>
				<postfield name="f" value="'.$f.'"/>
				<postfield name="ver" value="'.$ver.'"/>
				<go href="'.$SCRIPT_NAME.'" method="get"></go></anchor><br/>';
  if($ver=='html') print '<br/><div class="news"><a href="http://wap.wabx.ru">WabX.Ru</a></div>';
  if($ver=='wml') print '<br/><a href="http://wap.wabx.ru">WabX.Ru</a>';
  include('niz.php');
  }
}


?>