forked from keyanmca/LeVideoCollector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comment.php
executable file
·53 lines (42 loc) · 1.06 KB
/
comment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
session_start();
date_default_timezone_set("America/New_York");
include './dataAcces/dataAcces.php';
/**
*
* This functios write the coments in the selected format, it exist in watchvideo.php
*
*@return echoes the coments
*
**/
function writecomment($user,$coment){
echo '<div class="comment">
<h5><b>'.htmlspecialchars($user).' Says:</b></h5>
<p style="text-indent:40px;text-align:justify">'.htmlspecialchars($coment).'</p>
</div>';
}
if(isset($_SESSION['usrid'])){
if(isset($_POST['comment']) && isset($_POST['idvideo'])){
if($_POST['comment'] != ""){
if(insertcomment($_SESSION['usrid'],$_POST['idvideo'],$_POST['comment'],date('Y/m/d'))){
if($lastcomments = getcomments(20,$_POST['idvideo'])){
echo 'posted ';
while($row=pg_fetch_array($lastcomments)){
writecomment($row['username'],$row['coment']);
}
}else{
echo 'noposted';
}
}else{
echo 'noposted';
}
}else{
echo 'nocomment';
}
}else{
echo 'notdata';
}
}else{
echo 'nolog';
}
?>