View file hello.php

File size: 1.77Kb
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';

only_reg();
$set['title']='Приветствие';
include_once 'sys/inc/thead.php';
title();


if (isset($_POST['save']))
{
if (isset($_POST['hello']) && strlen2($_POST['hello'])<=35)
{
if (preg_match('#[^A-zА-я0-9 _\-\=\+\(\)\*\?\.,]#ui',$_POST['hello']))$err[]='Используются запрещенные символы';
else
{
$user['hello']=$_POST['hello'];
mysql_query("UPDATE `user` SET `hello` = '".my_esc($user['hello'])."' WHERE `id` = '$user[id]' LIMIT 1");
}
}
else $err[]='Привышает лимит символов';
if (!isset($err))msg('Сохранено');
}
err();
aut();



echo "<div class='act'>";
echo "<a class='act_noactive' href='/info.php?id=".$user['id']."'>Профиль</a>";
echo'<a class="act_active">Анкета</a>';
 echo"</div>";
echo "<div class='hide'>Приветствие странички</div>";

echo "<div class='block'>";



$hello = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$user[id]'"));

if ($hello['hello']!=NULL)
{echo "Приветствие: $hello[hello]";}
else
{echo "Приветствие: Не заполнено";}

echo "<form method='post' action='?$passgen'>\n";
echo "Текст приветствие:<br />\n<input type='text' name='hello' value='$user[hello]' maxlength='35' /><br />\n";
echo "<input type='submit' name='save' value='Сохранить' />\n";
echo "</form>\n";
echo"</div>";
include_once 'sys/inc/tfoot.php';
?>