Автор:

kristiqn2

Registered
Здравейте,
Направих си някакво подобие на форум :D и форума е интегриран с логин система но искам когато се добавя ново мнение на Автор да пише името с което съм логнат пробвах така но не става :
PHP:
$post = htmlspecialchars($_POST['post']);
$cid = htmlspecialchars($_POST['catt']);
$fid = htmlspecialchars($_POST['fid']);
$date = date("H:m");
$user = $_SESSION['username'];
$sql = mysql_query("INSERT topics (fid, cid, author, post, date) VALUES ('$fid', '$cid', '$user', '$post', '$date')") or die (mysql_error());
ето я и таблицата topics:
[sql]CREATE TABLE IF NOT EXISTS `topics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fid` int(11) NOT NULL,
`cid` int(11) NOT NULL,
`author` varchar(15) NOT NULL,
`post` text NOT NULL,
`date` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=27 ;[/sql]
ето я и таблицата users:
[sql]CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`username` varchar(15) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`rd` varchar(255) NOT NULL,
`pol` varchar(255) NOT NULL,
`grad` varchar(255) NOT NULL,
`timeonline` varchar(255) NOT NULL,
`lastactive` varchar(255) NOT NULL,
`level` varchar(255) NOT NULL DEFAULT 'member',
`totalvotes` int(11) NOT NULL,
`totalscore` int(11) NOT NULL,
`averagerating` varchar(4) NOT NULL DEFAULT '10.0',
`vip` varchar(3) NOT NULL DEFAULT 'no',
`active` varchar(3) NOT NULL DEFAULT 'yes',
`osnovna` text NOT NULL,
`osnovna_normal` text NOT NULL,
`osnovna_big` text NOT NULL,
`nastroenie` text NOT NULL,
`userip` text NOT NULL,
`plus` int(11) NOT NULL,
`minus` int(11) NOT NULL,
`vidim` varchar(255) NOT NULL,
`teglo` varchar(255) NOT NULL,
`ochi` varchar(255) NOT NULL,
`rust` varchar(255) NOT NULL,
`kosa` varchar(255) NOT NULL,
`za` varchar(255) NOT NULL,
`obrazuvanie` varchar(255) NOT NULL,
`profesia` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=170 ;
[/sql]
 

Горе