diff --git a/php forum/forum_bld.sql b/forum_bld.sql similarity index 100% rename from php forum/forum_bld.sql rename to forum_bld.sql diff --git a/php forum/category.php b/php forum/category.php deleted file mode 100644 index 5abb9b5..0000000 --- a/php forum/category.php +++ /dev/null @@ -1,86 +0,0 @@ -prepare($sql); -$stmt->bind_param('i', $_GET['id']); -$stmt->execute(); - -$result = $stmt->get_result(); - -if(!$result) -{ - echo 'The category could not be displayed, please try again later.'; -} -else -{ - if($result->num_rows == 0) - { - echo 'This category does not exist.'; - } - else - { - //display category data - while($row = $result->fetch_assoc()) - { - echo '

Topics in ′' . htmlentities($row['catName'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '′ category


'; - } - - //do a query for the topics - $sql = "SELECT topicNo, topicSubject, topicDate, topicCat - FROM topics - WHERE topicCat = ? - ORDER BY topicDate"; - - $stmt = $conn->prepare($sql); - $stmt->bind_param('i', $_GET['id']); - $stmt->execute(); - - $result = $stmt->get_result(); - - if(!$result) - { - echo 'The topics could not be displayed, please try again later.'; - } - else - { - if($result->num_rows == 0) - { - echo 'There are no topics in this category yet.'; - } - else - { - //prepare the table - echo ' - - - - '; - - while($row = $result->fetch_assoc()) - { - echo ''; - echo ''; - echo ''; - echo ''; - } - - //Close the table up - echo '
TopicCreated at
'; - echo '

' . htmlentities($row['topicSubject'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '

'; - echo '

'; - echo date_format(date_create($row['topicDate']), 'd/m/Y H:i:s'); - echo '
'; - } - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/connect.php b/php forum/connect.php deleted file mode 100644 index cabe808..0000000 --- a/php forum/connect.php +++ /dev/null @@ -1,15 +0,0 @@ -connect_error) { - die("Connection failed: " . $conn->connect_error); -} -?> diff --git a/php forum/create_cat.php b/php forum/create_cat.php deleted file mode 100644 index 6c2634e..0000000 --- a/php forum/create_cat.php +++ /dev/null @@ -1,48 +0,0 @@ -Create a category'; -if($_SESSION['signedIn'] == false | $_SESSION['userLevel'] != 1 ) -{ - //the user is not an admin - echo 'Sorry, you do not have sufficient rights to access this page.'; -} -else -{ - //the user has admin rights - if($_SERVER['REQUEST_METHOD'] != 'POST') - { - //the form hasn't been posted yet, display it - echo '
-
-

-
-

- -
'; - } - else - { - //the form has been posted, so save it - $sql = "INSERT INTO categories(catName, catDescr) - VALUES(?, ?)"; - - $stmt = $conn->prepare($sql); - $stmt->bind_param('ss', $_POST['catName'], $_POST['catDescr']); - - if(!$stmt->execute()) - { - //something went wrong, display the error - echo 'Error' . $conn->error; - } - else - { - echo 'New category succesfully added. Go Home.'; - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/create_topic.php b/php forum/create_topic.php deleted file mode 100644 index 6d67992..0000000 --- a/php forum/create_topic.php +++ /dev/null @@ -1,127 +0,0 @@ -Create a topic'; -if($_SESSION['signedIn'] == false) -{ - //the user is not signed in - echo 'Sorry, you have to be signed in to create a topic.'; -} -else -{ - //the user is signed in - if($_SERVER['REQUEST_METHOD'] != 'POST') - { - //the form hasn't been posted yet, display it - //retrieve the categories from the database for use in the dropdown - $sql = "SELECT catNo, catName, catDescr - FROM categories"; - - $result = $conn->query($sql); - - if(!$result) - { - //the query failed, uh-oh :-( - echo 'Error while selecting from database. Please try again later.'; - } - else - { - if($result->num_rows == 0) - { - //there are no categories, so a topic can't be posted - if($_SESSION['userLevel'] == 1) - { - echo 'You have not created categories yet.'; - } - else - { - echo 'Before you can post a topic, you must wait for an admin to create some categories.'; - } - } - else - { - - echo '
-
-

-
'; - - echo '

'; - - echo '
-

- -
'; - } - } - } - else - { - //start the transaction - $query = "BEGIN WORK;"; - - if(!$conn->query($query)) - { - //Damn! the query failed, quit - echo 'An error occured while creating your topic. Please try again later.'; - } - else - { - - //the form has been posted, so save it - //insert the topic into the topics table first, then we'll save the post into the posts table - $sql = "INSERT INTO topics(topicSubject, topicDate, topicCat, topicBy) - VALUES(?, NOW(), ?, ?)"; - - $stmt = $conn->prepare($sql); - $stmt->bind_param('sii', $_POST['topicSubject'], $_POST['topicCat'], $_SESSION['userNo']); - - if(!$stmt->execute()) - { - //something went wrong, display the error - echo 'An error occured while inserting your data. Please try again later.

' . $conn->error; - $sql = "ROLLBACK;"; - $conn->query($sql); - } - else - { - - //the first query worked, now start the second, posts query - //retrieve the id of the freshly created topic for usage in the posts query - $topicid = $conn->insert_id; - - $sql = "INSERT INTO posts(postContent, postDate, postTopic, postBy) - VALUES (?, NOW(), ?, ?)"; - - $stmt = $conn->prepare($sql); - $stmt->bind_param('sii', $_POST['postContent'], $topicid, $_SESSION['userNo']); - - if(!$stmt->execute()) - { - //something went wrong, display the error - echo 'An error occured while inserting your post. Please try again later.

' . $conn->error; - $sql = "ROLLBACK;"; - $conn->query($sql); - } - else - { - $sql = "COMMIT;"; - $conn->query($sql); - - //after a lot of work, the query succeeded! - echo 'You have succesfully created your new topic.'; - } - } - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/delete_post.php b/php forum/delete_post.php deleted file mode 100644 index 0cab905..0000000 --- a/php forum/delete_post.php +++ /dev/null @@ -1,92 +0,0 @@ -prepare($post_sql); -$stmt->bind_param('i', $_GET['post']); -$stmt->execute(); -$post_result = $stmt->get_result(); - -if(!$post_result) -{ - echo 'The post could not be retrieved, please try again later.'; -} -else -{ - if($_SERVER['REQUEST_METHOD'] != 'POST') - { - if(!$_SESSION['signedIn']) - { - echo 'You must be signed in to delete a post. You can also sign up for an account.'; - } - else if ($_SESSION['userNo'] != $post_result->fetch_assoc()['postBy']) - { - echo 'You cannot edit this post. You are not OP!'; - } - else - { - - echo '

Are you sure you want to remove this post?

'; - - //show edit form - echo '
-
- - -
-
- -
'; - } - } - else - { - //the form has been posted, now it's time to process. - //start the transaction - $query = "BEGIN WORK;"; - - if(!$conn->query($query)) - { - //Damn! the query failed, quit - echo 'An error occured while editing your post. Please try again later.'; - } - else - { - //the form has been posted, so save it - //update the post in the posts table then save it - $update_sql = " UPDATE posts - SET postContent = ? - WHERE postNo = ?"; - - $update_stmt = $conn->prepare($update_sql); - $update_stmt->bind_param('si', $content, $_GET['post']); - - if(!$update_stmt->execute()) - { - //something went wrong, display the error - echo 'An error occured while inserting your data. Please try again later.

' . $conn->error; - $sql = "ROLLBACK;"; - $conn->query($sql); - } - else - { - $sql = "COMMIT;"; - $conn->query($sql); - - //after a lot of work, the query succeeded! - echo 'You have succesfully removed your post.'; - } - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/edit_post.php b/php forum/edit_post.php deleted file mode 100644 index 28ebb49..0000000 --- a/php forum/edit_post.php +++ /dev/null @@ -1,89 +0,0 @@ -prepare($post_sql); -$stmt->bind_param('i', $_GET['post']); -$stmt->execute(); -$post_result = $stmt->get_result(); - -if(!$post_result) -{ - echo 'The post could not be retrieved, please try again later.'; -} -else -{ - if($_SERVER['REQUEST_METHOD'] != 'POST') - { - $post_result = $post_result->fetch_assoc(); - - if(!$_SESSION['signedIn']) - { - echo 'You must be signed in to edit a post. You can also sign up for an account.'; - } - else if ($_SESSION['userNo'] != $post_result['postBy']) - { - echo 'You cannot edit this post. You are not OP!'; - } - else - { - $content = htmlentities(stripslashes($post_result['postContent'])); - - //show edit form - echo '
-
-
-

- -
'; - } - } - else - { - //the form has been posted, now it's time to process. - //start the transaction - $query = "BEGIN WORK;"; - - if(!$conn->query($query)) - { - //Damn! the query failed, quit - echo 'An error occured while editing your post. Please try again later.'; - } - else - { - //the form has been posted, so save it - //update the post in the posts table then save it - $update_sql = " UPDATE posts - SET postContent = ? - WHERE postNo = ?"; - - $update_stmt = $conn->prepare($update_sql); - $update_stmt->bind_param('si', $_POST['postContent'], $_GET['post']); - - if(!$update_stmt->execute()) - { - //something went wrong, display the error - echo 'An error occured while inserting your data. Please try again later.

' . $conn->error; - $sql = "ROLLBACK;"; - $conn->query($sql); - } - else - { - $sql = "COMMIT;"; - $conn->query($sql); - - //after a lot of work, the query succeeded! - echo 'You have succesfully edited your post.'; - } - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/footer.php b/php forum/footer.php deleted file mode 100644 index 8ad6577..0000000 --- a/php forum/footer.php +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/php forum/header.php b/php forum/header.php deleted file mode 100644 index 8f4899e..0000000 --- a/php forum/header.php +++ /dev/null @@ -1,35 +0,0 @@ - - - - Ink's Forum - - - -
- - - - -
diff --git a/php forum/index.php b/php forum/index.php deleted file mode 100644 index 996d2f9..0000000 --- a/php forum/index.php +++ /dev/null @@ -1,73 +0,0 @@ -query($sql)) -{ - echo 'The categories could not be displayed, please try again later.'; -} -else -{ - if($result->num_rows == 0) - { - echo 'No categories defined yet.'; - } - else - { - //prepare the table - echo ' - - - - '; - - while($row = $result->fetch_assoc()) - { - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
CategoryLast topic
'; - echo '

' . htmlentities($row['catName'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '

' . htmlentities($row['catDescr'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); - echo '
'; - - //fetch last topic for each cat - $topicsql = "SELECT topicNo, topicSubject, topicDate, topicCat - FROM topics - WHERE topicCat = ? - ORDER BY topicDate DESC - LIMIT 1"; - - $stmt = $conn->prepare($topicsql); - $stmt->bind_param('i', $row['catNo']); - $stmt->execute(); - - if(!$topicsresult = $stmt->get_result()) - { - echo 'Last topic could not be displayed.'; - } - else - { - if($topicsresult->num_rows == 0) - { - echo 'no topics'; - } - else - { - while($topicrow = $topicsresult->fetch_assoc()) - echo '' . htmlentities($topicrow['topicSubject'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . ' on ' . htmlentities(date('d-m-Y', strtotime($topicrow['topicDate'])), ENT_QUOTES | ENT_HTML5, 'UTF-8'); - } - } - echo '
'; - } -} - -include 'footer.php'; -?> diff --git a/php forum/reply.php b/php forum/reply.php deleted file mode 100644 index 34e182a..0000000 --- a/php forum/reply.php +++ /dev/null @@ -1,39 +0,0 @@ -prepare($sql); - $stmt->bind_param('sii', $_POST['replyContent'], $_GET['id'], $_SESSION['userNo']); - - if(!$stmt->execute()) - { - echo 'Your reply has not been saved, please try again later.'; - } - else - { - echo 'Your reply has been saved, check out the topic.'; - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/signin.php b/php forum/signin.php deleted file mode 100644 index d3e1bae..0000000 --- a/php forum/signin.php +++ /dev/null @@ -1,103 +0,0 @@ -Sign in
'; - -//first, check if the user is already signed in. If that is the case, there is no need to display this page -if(isset($_SESSION['signedIn']) && $_SESSION['signedIn'] == true) -{ - echo 'You are already signed in, you can sign out if you want.'; -} -else -{ - if($_SERVER['REQUEST_METHOD'] != 'POST') - { - /*the form hasn't been posted yet, display it - note that the action="" will cause the form to post to the same page it is on */ - echo '
- Username:
- Password:
- -
'; - } - else - { - /* so, the form has been posted, we'll process the data in three steps: - 1. Check the data - 2. Let the user refill the wrong fields (if necessary) - 3. Varify if the data is correct and return the correct response - */ - $errors = array(); /* declare the array for later use */ - - if(!isset($_POST['userName'])) - { - $errors[] = 'The username field must not be empty.'; - } - - if(!isset($_POST['userPass'])) - { - $errors[] = 'The password field must not be empty.'; - } - - if(!empty($errors)) /*check for an empty array, if there are errors, they're in this array (note the ! operator)*/ - { - echo 'Uh-oh.. a couple of fields are not filled in correctly..

'; - echo ''; - } - else - { - //the form has been posted without errors, so save it - //notice the use of mysql_real_escape_string, keep everything safe! - //also notice the sha1 function which hashes the password - $sql = "SELECT userNo, userName, userLevel - FROM users - WHERE userName = ? AND userPass = ?"; - - $stmt = $conn->prepare($sql); - $stmt->bind_param('ss', $_POST['userName'], sha1($_POST['userPass'])); - $stmt->execute(); - - if(!$result = $stmt->get_result()) - { - //something went wrong, display the error - echo 'Something went wrong while signing in. Please try again later.'; - //echo $conn->error; //debugging purposes, uncomment when needed - } - else - { - //the query was successfully executed, there are 2 possibilities - //1. the query returned data, the user can be signed in - //2. the query returned an empty result set, the credentials were wrong - if($result->num_rows == 0) - { - echo 'You have supplied a wrong user/password combination. Please try again.'; - } - else - { - //set the $_SESSION['signed_in'] variable to TRUE - $_SESSION['signedIn'] = true; - - //we also put the user_id and user_name values in the $_SESSION, so we can use it at various pages - while($row = $result->fetch_assoc()) - { - $_SESSION['userNo'] = $row['userNo']; - $_SESSION['userName'] = $row['userName']; - $_SESSION['userLevel'] = $row['userLevel']; - } - - echo 'Welcome, ' . htmlentities($_SESSION['userName'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '.
Proceed to the forum overview.'; - } - } - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/signout.php b/php forum/signout.php deleted file mode 100644 index 4ca0f97..0000000 --- a/php forum/signout.php +++ /dev/null @@ -1,25 +0,0 @@ -Sign out'; - -//check if user if signed in -if($_SESSION['signedIn'] == true) -{ - //unset all variables - $_SESSION['signedIn'] = NULL; - $_SESSION['userName'] = NULL; - $_SESSION['userNo'] = NULL; - - echo 'Succesfully signed out, thank you for visiting '; - echo "Ink's Things."; -} -else -{ - echo 'You are not signed in. Would you like to?'; -} -include 'footer.php'; -?> - diff --git a/php forum/signup.php b/php forum/signup.php deleted file mode 100644 index 30b19db..0000000 --- a/php forum/signup.php +++ /dev/null @@ -1,95 +0,0 @@ -Sign up
'; - -if($_SERVER['REQUEST_METHOD'] != 'POST') -{ - /*the form hasn't been posted yet, display it - note that the action="" will cause the form to post to the same page it is on */ - echo '
- Username:
- Password:
- Password again:
- E-mail:
- -
'; -} -else -{ - /* so, the form has been posted, we'll process the data in three steps: - 1. Check the data - 2. Let the user refill the wrong fields (if necessary) - 3. Save the data - */ - $errors = array(); /* declare the array for later use */ - - if(isset($_POST['userName'])) - { - //the user name exists - if(!ctype_alnum($_POST['userName'])) - { - $errors[] = 'The username can only contain letters and digits.'; - } - if(strlen($_POST['userName']) > 30) - { - $errors[] = 'The username cannot be longer than 30 characters.'; - } - } - else - { - $errors[] = 'The username field must not be empty.'; - } - - - if(isset($_POST['userPass'])) - { - if($_POST['userPass'] != $_POST['userPassCheck']) - { - $errors[] = 'The two passwords did not match.'; - } - } - else - { - $errors[] = 'The password field cannot be empty.'; - } - - if(!empty($errors)) /*check for an empty array, if there are errors, they're in this array (note the ! operator)*/ - { - echo 'Uh-oh.. a couple of fields are not filled in correctly..

'; - echo ''; - echo 'Click here to try again.'; - } - else - { - //the form has been posted without, so save it - //notice the use of mysql_real_escape_string, keep everything safe! - //also notice the sha1 function which hashes the password - $sql = "INSERT INTO users (userName, userPass, userEmail, userDate, userLevel) VALUES (?, ?, ?, NOW(), 0)"; - - $stmt = $conn->prepare($sql); - $stmt->bind_param('sss', $_POST['userName'], sha1($_POST['userPass']), $_POST['userEmail']); - - if(!$stmt->execute()) - { - //something went wrong, display the error - echo 'Something went wrong while registering. Please try again later.'; - //echo $conn->error; //debugging purposes, uncomment when needed - //echo var_dump($stmt) . "|" . $uname . "|" . $upass . "|" . $uemail; - } - else - { - echo 'Succesfully registered. You can now sign in and start posting! :-)'; - } - } -} - -include 'footer.php'; -?> diff --git a/php forum/style.css.bak b/php forum/style.css.bak deleted file mode 100644 index 302ae8a..0000000 --- a/php forum/style.css.bak +++ /dev/null @@ -1,135 +0,0 @@ -/* BEGIN BASIC FORUM STYLES */ -body { - background-color: #0F0F0F; - text-align: center; /* make sure IE centers the page too */ - font-family: sans-serif; - color: #4B0082; -} - -#wrapper { - position: relative; - width: 80%; - margin: 0 auto; /* center the page */ -} - -#header { - text-align: left; - padding-left: 8%; -} - -#content { - border: 5px dashed pink; - border-top: none; /* don't want a line across the middle so removed this */ - float: left; - padding: 20px 30px; - text-align: left; - width: 100%; /* fill up the entire div */ - margin-top: 5px; -} - -#menu { - margin-top: 5%; - float: left; - border: 5px dashed pink; - border-bottom: none; /* avoid a double border */ - clear: both; /* clear:both makes sure the content div doesn't float next to this one but stays under it */ - width:100%; - height:50px; - padding: 0 30px; - text-align: left; - font-size: 85%; -} - -#menu a:hover { - background-color: #009FC1; -} - -#userbar {; - float: right; - width: 300px; - height: 50px; -} - -#userBarMsg { - color: #FAFAFA; -} - -#footer { - clear: both; -} - -/* begin table styles */ -table { - border-collapse: collapse; - width: 100%; -} - -table, td, th { - border: 1px solid pink; -} - -table a:hover { - color: pink; - text-decoration: none; -} - -th { - background-color: #2E2E2E; - color: #FAFAFA; - padding: 5px; -} - -td { - padding: 5px; -} - -/* Begin font styles */ -h1 { - font-size: 50pt; - margin-bottom: -25px; -} - -#footer { - color: #FAFAFA; -} - -h3 { - margin: 0; - padding: 0; -} - -a { - text-decoration: none; - color: purple; -} - -/* Menu styles */ -.item { - background-color: #2E2E2E; - border: 3px dashed pink; - padding: 10px; - text-decoration: none; - color: #FAFAFA; - margin-right: 10px; -} - -.leftpart { - width: 70%; -} - -.rightpart { - width: 30%; -} - -.small { - font-size: 75%; -} -#footer { - font-size: 9pt; - padding: 3px 0 0 0; -} - -textarea { - width: 500px; - height: 200px; -} diff --git a/php forum/topic.php b/php forum/topic.php deleted file mode 100644 index 9cfe1e0..0000000 --- a/php forum/topic.php +++ /dev/null @@ -1,103 +0,0 @@ -prepare($sql); -$stmt->bind_param('i', $topic); -$stmt->execute(); - -if(!$result = $stmt->get_result()) -{ - echo 'The topic could not be displayed, please try again later.'; -} -else -{ - if($result->num_rows == 0) - { - echo 'This topic doesn′t exist.'; - } - else - { - while($row = $result->fetch_assoc()) - { - //display post data - echo ' - - - '; - - //fetch the posts from the database - $posts_sql = "SELECT posts.postNo, posts.postTopic, posts.postContent, posts.postDate, posts.postBy, users.userNo, users.userName - FROM posts LEFT JOIN users - ON posts.postBy = users.userNo - WHERE posts.postTopic = ? - ORDER BY posts.postDate"; - - $stmt = $conn->prepare($posts_sql); - $stmt->bind_param('i', $topic); - $stmt->execute(); - $posts_result = $stmt->get_result(); - - if(!$posts_result) - { - echo '
' . htmlentities($row['topicSubject'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '
The posts could not be displayed, please try again later.
'; - } - else - { - while($posts_row = $posts_result->fetch_assoc()) - { - - $name = htmlentities($posts_row['userName'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); - $date = htmlentities(date_format(date_create($posts_row['postDate']), 'd/m/Y H:i:s'), ENT_QUOTES | ENT_HTML5, 'UTF-8'); - $content = htmlentities(stripslashes($posts_row['postContent']), ENT_QUOTES | ENT_HTML5, 'UTF-8'); - $poster = htmlentities($posts_row['postBy'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); - $post = htmlentities($posts_row['postNo'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); - - echo ''; - if($_SESSION['userNo'] != $poster) - { - echo '' . $content . ''; - } - else - { - echo '' . $content . - '[edit] ' . - '[delete]'; - } - - echo '' . $name . '
' . $date . ''; - echo ''; - } - - } - if(!$_SESSION['signedIn']) - { - echo 'You must be signed in to reply. You can also sign up for an account.'; - //finish the table - echo ''; - } - else - { - //finish the table - echo ''; - //show reply box - echo '
-
-
-

- -
'; - } - } - } -} - -include 'footer.php'; -?> diff --git a/php gallery/clear.php b/php gallery/clear.php deleted file mode 100644 index 1079ba7..0000000 --- a/php gallery/clear.php +++ /dev/null @@ -1,43 +0,0 @@ -query($commentsdrop); - -$uploadsdrop="DROP TABLE uploads"; -$conn->query($uploadsdrop); - -$uploadscreate=" -CREATE TABLE uploads ( -uploadNo INT(8) NOT NULL AUTO_INCREMENT, -uploadDir VARCHAR(255), -uploadName VARCHAR(255), -PRIMARY KEY (uploadNo) -)"; -$conn->query($uploadscreate); - -$commentscreate=" -CREATE TABLE comments ( -commentNo INT(8) NOT NULL AUTO_INCREMENT, -commentName VARCHAR(255), -commentText VARCHAR(255), -uploadNo INT(8) NOT NULL, -PRIMARY KEY (commentNo), -FOREIGN KEY (uploadNo) REFERENCES uploads(uploadNo) -)"; - -$conn->query($commentscreate); - -$addstart="INSERT INTO uploads (uploadDir,uploadName) VALUES (1,1)"; -$conn->query($addstart); - -echo ""; - -?> diff --git a/php gallery/comment_send.php b/php gallery/comment_send.php deleted file mode 100644 index 3100224..0000000 --- a/php gallery/comment_send.php +++ /dev/null @@ -1,27 +0,0 @@ -prepare($sql); -$stmt->bind_param('ssi', $name, $comment, $id); - - -if ($result = $stmt->execute()) - { - echo '1 record added.' . '
'; - echo 'id: ' . htmlentities($id, ENT_QUOTES | ENT_HTML5, 'UTF-8') . ' comment: ' . htmlentities($comment, ENT_QUOTES | ENT_HTML5, 'UTF-8') . ' name: ' . htmlentities($name, ENT_QUOTES | ENT_HTML5, 'UTF-8'); - - } -else{ - echo 'update failed.' . $conn->error . '
'; - } - -echo ""; - -?> diff --git a/php gallery/connect.php b/php gallery/connect.php deleted file mode 100644 index d5e94b5..0000000 --- a/php gallery/connect.php +++ /dev/null @@ -1,15 +0,0 @@ -connect_error) { - die("Connection failed: " . $conn->connect_error); -} -?> diff --git a/php gallery/foot.php b/php gallery/foot.php deleted file mode 100644 index 3b85b38..0000000 --- a/php gallery/foot.php +++ /dev/null @@ -1,7 +0,0 @@ -
- -
- - diff --git a/php gallery/gallery-bld.sql b/php gallery/gallery-bld.sql deleted file mode 100644 index 031e2b3..0000000 --- a/php gallery/gallery-bld.sql +++ /dev/null @@ -1,18 +0,0 @@ -DROP TABLE comments; -DROP TABLE uploads; - -CREATE TABLE uploads ( -uploadNo INT(8) NOT NULL AUTO_INCREMENT, -uploadDir VARCHAR(255), -uploadName VARCHAR(255), -PRIMARY KEY (uploadNo) -); - -CREATE TABLE comments ( -commentNo INT(8) NOT NULL AUTO_INCREMENT, -commentName VARCHAR(255), -commentText VARCHAR(255), -uploadNo INT(8) NOT NULL, -PRIMARY KEY (commentNo), -FOREIGN KEY (uploadNo) REFERENCES uploads(uploadNo) -); diff --git a/php gallery/head.php b/php gallery/head.php deleted file mode 100644 index 3f786aa..0000000 --- a/php gallery/head.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Gallery - - - -
- - - -
diff --git a/php gallery/index.php b/php gallery/index.php deleted file mode 100644 index 6bbaf7d..0000000 --- a/php gallery/index.php +++ /dev/null @@ -1,82 +0,0 @@ -query("SELECT MAX(uploadNo) AS 'max' FROM uploads"); -$maxid=intval($result->fetch_assoc()['max']); -$x= 1; - -if($maxid == 1) { - - echo '

Be the first to submit an image!

'; - -} -else { - - while($x < $maxid) { - - $x++; - - $uploadNo=$x; - - $sql="SELECT uploadDir, uploadName FROM uploads WHERE uploadNo = ?"; - $stmt=$conn->prepare($sql); - $stmt->bind_param('i', $x); - $stmt->execute(); - - $post = $stmt->get_result()->fetch_assoc(); - - echo '
-

' . htmlentities($post["uploadName"], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '

-
-
- - - - -
'; - - echo "
"; - - $sql = "SELECT * FROM comments WHERE uploadNo = ?"; - $stmt = $conn->prepare($sql); - $stmt->bind_param('i', $uploadNo); - $stmt->execute(); - - $comments = $stmt->get_result(); - - while($comment = $comments->fetch_assoc()) { - echo '

' . htmlentities($comment['commentText'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . ' - ' . htmlentities($comment['commentName'], ENT_QUOTES | ENT_HTML5, 'UTF-8') . '

'; - } - - echo "
"; - echo '
'; - - } - -} - -include 'foot.php'; - -?> - - - - - - - - - - - - - - - - - - - - diff --git a/php gallery/style.css.bak b/php gallery/style.css.bak deleted file mode 100644 index 3e3481f..0000000 --- a/php gallery/style.css.bak +++ /dev/null @@ -1,97 +0,0 @@ -/* BEGIN BASIC FORUM STYLES */ -body { - background-color: #0F0F0F; - text-align: center; /* make sure IE centers the page too */ - font-family: sans-serif; - color: #4B0082; -} - -#wrapper { - left:20%; - right:20%; - width:75%; - margin: 0 auto; /* center the page */ -} - -#header { - text-align: left; - padding-left: 8%; -} - -#content { - border: 5px dashed pink; - border-top: none; - float: left; - padding: 20px 30px; - text-align: left; - width: 95%; /* fill up the entire div */ - margin-top: 5px; -} - -#placeholder { - color:pink; - text-align: center; - font-size: 90pt; -} - -img { - height:auto; - width:auto; - max-width:800px; - max-height:600px; -} - -p.comment{ -} - -#footer { - clear: both; -} - -/* Begin font styles */ -h1 { - font-size: 50pt; - margin-bottom: -25px; -} - -#footer { - color: #FAFAFA; -} - -h3 { - margin: 0; - padding: 0; -} - -/* Menu styles */ - -#menu { - margin-top: 5%; - float: left; - border: 5px dashed pink; - border-bottom: none; /* avoid a double border */ - clear: both; /* clear:both makes sure the content div doesn't float next to this one but stays under it */ - width:95%; - height:50px; - padding: 0 30px; - text-align: left; - font-size: 90%; -} - -#menu a:hover { - background-color: #009FC1; -} - -.item { - background-color: #2E2E2E; - border: 3px dashed pink; - color: #FAFAFA; - padding: 10px; - text-decoration: none; - margin-right: 10px;; -} - -#footer { - font-size: 65%; - padding: 3px 0 0 0; -} diff --git a/php gallery/upload.php b/php gallery/upload.php deleted file mode 100644 index 245cafb..0000000 --- a/php gallery/upload.php +++ /dev/null @@ -1,22 +0,0 @@ -Upload a Picture! - -
- - -

- - -

- - -
'; - -include 'foot.php'; - -?> - diff --git a/php gallery/upload_file.php b/php gallery/upload_file.php deleted file mode 100644 index 31f6c72..0000000 --- a/php gallery/upload_file.php +++ /dev/null @@ -1,89 +0,0 @@ - 0) - { - echo "Return Code: " . $_FILES['file']['error'] . "
"; - } - else - { - echo "Upload: " . $_FILES['file']['name'] . "
"; - echo "Type: " . $_FILES['file']['type'] . "
"; - echo "Size: " . ($_FILES['file']['size'] / 1024) . " kB
"; - echo "Temp file: " . $_FILES['file']['tmp_name'] . "
"; - if (file_exists("uploaded/" . $_FILES["file"]["name"])) - { - echo $_FILES['file']['name'] . " already exists. "; - } - else - { - move_uploaded_file($_FILES['file']['tmp_name'], - "uploaded/" . $_FILES['file']['name']); - - //suppressed to reduce loadtime. - //echo "Stored in: " . "uploaded/" . $_FILES['file']['name'] . "
"; - - $sql="INSERT INTO uploads (uploadDir, uploadName) VALUES (?, ?)"; - $stmt = $conn->prepare($sql); - $stmt->bind_param('ss', $dir, $name); - - if ($stmt->execute()) - { - //suppressed to reduce loadtime. - //echo "New record created successfully"; - } - else - { - echo "Error: " . $sql . "
" . $conn->error; - } - } - } - } - else - { - echo "Invalid file"; - - echo '
';
-		print_r($_FILES);
-		echo '
'; - } - -echo ""; - -?> - - - - - - - - - - - - - - - - -