Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
CREATE TABLE IF NOT EXISTS `comment` (
`id` int(4) NOT NULL auto_increment,
`article` varchar(255) NOT NULL,
`author` varchar(255) NOT NULL,
`comment` longtext NOT NULL,
`date` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
<table>
<tr>
<th>КОМЕНТАРИ <br /><br /></th>
</tr>
<tr><td><center>
<?php if($_SESSION['username'] == NULL) {
print "Влезте в профила си,за да можете да пишете коментари!";
}
else
{ ?>
</center></td></tr>
<form action="" method="post">
<tr>
<td><textarea name="comment" cols="30" rows="10" class="textinput" id="m"></textarea></td>
</tr>
<tr>
<td>
<input name="submit" type="submit" class="btn" id="submit" value="Изпрати">
<input name="button2" type="reset" class="btn" id="button2" value="Изчисти">
<?php
$id = $_GET['id'];
if(isset($_POST['submit'])){
$date = date("d.m.Y");
$sql = mysql_query("INSERT INTO comment (id, article, author, comment, date) VALUES (NULL, '$id', '$user', '$_POST[comment]', '$date')") or die(mysql_error());
}
else {
echo "";
}
?>
</form>
<br>
<?php
$query = mysql_query("SELECT * FROM `comment` WHERE `article`='$id'") or die(mysql_error());
while($raw = mysql_fetch_array($query)){
echo "
<tr>
<td class=\"comment\" style=\"border-bottom: 1px solid #000000\">$raw[date] | <span class=\"style2\"><b>$raw[author]</b></span><br>
$raw[comment]</td>
</tr>";
}
}
?>
</table>