PhotoShare/controllers/addComments.php
Muhammad Anas Rashid 34753111ed My First Web application .. a real shitty one
My First Web application .. a real shitty one
2016-01-28 23:32:09 +05:00

25 lines
446 B
PHP

<?php
session_start();
if(isset($_SESSION['user']))
{
$temp=$_SESSION['user'];
}
else
{
header("Location: ../views/signinPage.php?message=".urlencode("Login again!"));
}
?>
<?php
if($_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;
}
}
?>