forked from phamtienthanh-luvina/samforum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opened_category.php
68 lines (52 loc) · 1.9 KB
/
opened_category.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
</html>
<?PHP
//******************************************//
//* This copyright notice must not be removed
//* under any circumstances.
//* It must stay intact in all the files.
//* Samforum
//* Version 1.0
//* Script created by Samiuddin Samiuddin
//* Email: phpdevsami@gmail.com
//* Skype: n0h4cks
//* - This is not an open source project, functions/classes
//* or any other code form this script cannot be
//* used for other scripts or applications.
//* You are not allowed to resell this script.
//* - You are free to make modification/changes,
//* however it must be for your own use.
//*********************************************************************//
//start session
session_start();
include_once("general/general_class.php");
include_once("connection_to_db.php");
include_once("show_data_class.php");
$Data_display = new Data_display($conn);
include_once("create_thread/create_thread_class.php");
//$Create_thread = new create($conn);
//if get variable contains cat_id value..
if(isset($_GET["cat_id"])){
//show the threads that belong to that form
$Data_display->show_threads();
//if user is logged in then.. let him create a thread.
if($Data_display->is_user_logged_in("logged_in")){
echo "<form method=\"POST\" action=\"{$_SERVER['PHP_SELF']}?cat_id={$_GET['cat_id']}\">
<p class='form_title'> Thread title: </p> <input name=\"thread_title\" type=\"text\"> </br>
<p class='form_title'>Thread body: </p> <textarea name=\"thread_body\" type=\"text\"></textarea></br>
<input name=\"submit_thread\" type=\"submit\" value=\"Submit thread\">
</form>";
//class to create thread.
if(isset($_POST["submit_thread"])){
$Create = new create($conn);
}
}else{
echo "You need to login to create a new thread";
}
}else{
echo header("location: index.php");
}
?>