Skip to content

Commit

Permalink
Comment added to the story.
Browse files Browse the repository at this point in the history
  • Loading branch information
enderimen committed May 9, 2018
1 parent 6197fb0 commit cde3e8b
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions php/transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,62 @@
}
}


// Hikayeye yorum yapma

if (isset($_POST['comment-button'])) {

$comment = trim($_POST['comment']);
$rstoryID = trim($_POST['rstoryID']);
$userID = trim($_POST['userID']);

$add_story_comment = mysqli_query( $connection, "INSERT INTO comments
(
storyID,
story_authorID,
comment_authorID,
comment
)
VALUES
(
'$rstoryID',
'$userID',
'".$_SESSION['id']."',
'$comment'
)");

if ($add_story_comment) {

header("refresh:0.05;url=story-read.php?rstory_id=".$rstoryID."");
}
}
// Hikayedeki yorum yorum yapma

if (isset($_POST['comment-to-comment-button'])) {

$comment_to = trim($_POST['comment_to']);
$rstoryID = trim($_POST['rstoryID']);
$commentID = trim($_POST['commentID']);


echo $comment_to.$rstoryID.$commentID;

$add_comment_to_comment_sql = mysqli_query( $connection, "INSERT INTO comment_to_comment
(
c_t_c_content,
commentID,
c_to_c_authorID
)
VALUES
(
'$comment_to',
'$commentID',
'".$_SESSION['id']."'
)");

if ($add_comment_to_comment_sql) {

header("refresh:0.05;url=story-read.php?rstory_id=".$rstoryID."");
}
}
?>

0 comments on commit cde3e8b

Please sign in to comment.