Example #1
0
<!DOCTYPE html>
<html  lang="en-US">
<?php 
require_once '../includes/initialize.php';
//Load Session details...
if (!$session->is_logged_in()) {
    session_start();
}
if (!isset($_SESSION['u_id'])) {
    redirect_to('../homepage.php');
}
$user = Users::find_by_id($_SESSION['u_id']);
if (isset($_GET['id'])) {
    $frm = forums::find_by_id($_GET['id']);
}
if (isset($_POST['submit'])) {
    $c = new comments();
    $c->c_o_ID = $_GET['id'];
    $c->c_authorID = $_SESSION['u_id'];
    $c->c_text = $_POST["text"];
    $c->c_type = 0;
    $c->c_time = date('Y-m-d H:i:s');
    $c->create();
    redirect_to("forums2.php");
}
if (isset($_POST['submit1'])) {
    $c = new comments();
    $c->c_o_ID = $_GET['id'];
    $c->c_authorID = $_SESSION['u_id'];
    $c->c_text = $_POST["text"];
    $c->c_type = 1;
Example #2
0
<!DOCTYPE html>
<html  lang="en-US">
<?php 
require_once '../includes/initialize.php';
//Load Session details...
if (!$session->is_logged_in()) {
    session_start();
}
if (!isset($_SESSION['u_id'])) {
    redirect_to('../homepage.php');
}
$user = Users::find_by_id($_SESSION['u_id']);
$forum = forums::find_by_id(1);
if (isset($_POST['submit'])) {
    $c = new comments();
    //$c=  comment::find_by_id($_SESSION['user_id']);
    $c->c_o_ID = 2;
    $c->c_authorID = 2;
    $c->c_text = $_POST["text"];
    $c->c_type = 0;
    $c->c_time = date('Y-m-d H:i:s');
    $c->create();
}
$sql = "SELECT * FROM comment ORDER BY c_id desc limit 1";
$result_set = $database->execute_query($sql);
$row = $database->fetch_array($result_set);
$c_id = array_shift($row);
?>

<meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>