noordean

reply.php

Sep 29th, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require_once('class.php');
  4. $user = new User();
  5. if (!$user->isLoggedIn()) {
  6.     header("Location:login_html.php");
  7. }
  8. echo "Welcome ".$_SESSION['user']."<br>";
  9. echo "<a href='redirect.php'>Logout</a> <br>";
  10. if(isset($_POST['submit'])){
  11.     if(!empty($_POST['message'])){
  12.         $message = $user->escapeInput($_POST['message']);
  13.         if($user->insertPost($message,$_SESSION['user'],$_GET['refid'])){
  14.             header("Location:thread.php?refid=".$_GET['refid']);
  15.         }
  16.     }
  17.     else{
  18.         echo "<p style='color:red'>Insert the your reply</p>";
  19.     }
  20. }
Add Comment
Please, Sign In to add comment