PhotoShare/controllers/addComments.php
2026-04-29 00:42:13 +02:00

25 lines
480 B
PHP

<?php
session_start();
if(isset($_SESSION['user']))
{
$temp=$_SESSION['user'];
}
else
{
header("Location: ../views/signinPage.php?message=".urlencode("Login again!"));
}
?>
<?php
if(isset($_REQUEST['thecomment']) && $_REQUEST['thecomment']!="")
{
require_once("../models/comment.php");
$rs = comment ::insertComment($_REQUEST['imgId'],$temp['username'], $_REQUEST['thecomment'] );
if($rs == false)
{
echo "Comment not Added!", PHP_EOL;
}
}
?>