From 2c571668311715536b2cfd1aeb702b75bea73241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E9=96=8E=E5=82=91?= Date: Mon, 6 Jun 2016 21:55:51 +0800 Subject: [PATCH] Changed comment.php method to GET(for bookmarking that one comment) -To do list below: update the security on passwords to hash --- .DS_Store | Bin 6148 -> 6148 bytes comment.php | 9 +++------ home.php | 14 +++++++------- style.css | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.DS_Store b/.DS_Store index bf8c71943a2f93f9641baf3daf89c845bca9dd60..5b8be911030deffd196538e180bf0fb4add6d066 100644 GIT binary patch delta 167 zcmZoMXfc@JFDS^sz`)4BAi$85ZWx@LpIfk5kYhD-JxG{^L60GwA(Np5CIu8@U|?bo zLYB+TcX3H6ElFlzxLmm?0i*z-FE>90r(8h>#5%AJ_75P6hrx)!fWeT#jKN^D6iY4h JW_FIh`~cHkBhCN- delta 47 zcmZoMXfc@JFUrfnz`)4BAi%(2z+lQ?3?%g!iZ>=MXJ+KxT*K1MJh7l)Gdss$egM"; -if(isset($_POST['view_reply_parent'])) -{ - $_SESSION['view_reply_parent'] = $_POST['view_reply_parent']; -} -$parent_id = $_SESSION['view_reply_parent']; + +$parent_id = $_GET["m_id"]; if(isset($_POST['submit_comment'])) { if($_POST['comment']!='') @@ -91,7 +88,7 @@ //display the parent message $sql_select = "SELECT msg_id,msg, username,msg_time,uid FROM messages, users - WHERE messages.uid = users.user_id AND messages.msg_id = $parent_id"; + WHERE messages.msg_id = $parent_id AND messages.uid = users.user_id"; $res=$conn->prepare($sql_select); $res->execute(); ?> diff --git a/home.php b/home.php index 9edd942..1c19a22 100644 --- a/home.php +++ b/home.php @@ -93,20 +93,20 @@ ORDER BY cmt_time DESC "; $num_of_replies = $conn->query($sql_count); $num_result = $num_of_replies->fetch(PDO::FETCH_NUM)[0]; - if($num_result%2==1|$num_result==0) + if($num_result<2) { echo ""; - echo "
"; - echo ""; + echo ""; + echo ""; echo "
"; } else { echo ""; - echo "
"; - echo ""; + echo ""; + echo ""; echo "
"; } diff --git a/style.css b/style.css index 45adff3..b962443 100644 --- a/style.css +++ b/style.css @@ -264,7 +264,7 @@ th#actions } th#replies { -width:16em; +width:18em; } th:first-child {