<?php
if(isset($_POST['add_comment'])){
$agent_id = mysql_real_escape_string(htmlentities($_POST['agent_id']));
$comment_id = mysql_real_escape_string(htmlentities($_POST['bookId']));
$comment = mysql_real_escape_string(htmlentities($_POST["business_comment"]));
// insert comment/reply
$sql_upd_feedback = "UPDATE b_feedback SET feedback_comment='$comment' WHERE feedback_id='$comment_id'";
$query_upd_feedback = mysql_query($sql_upd_feedback) or die(mysql_error());
if($query_upd_feedback){
header("Location: feedback.php?aid=" . $agent_id);
}
else {
header("Location: feedback.php?aid=" . $agent_id);
}
}
else {
header("Location: logout.php");
}
?>
<script>
$(document).on("click", ".open-AddBookDialog", function (e) {
e.preventDefault();
var _self = $(this);
var myBookId = _self.data('id');
$("#bookId").val(myBookId);
$(_self.attr('href')).modal('show');
});
</script>
<!-- form in modal -->
<div class="modal fade" id="addBookDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
<form role="form" action="add_feedback_comment_script.php" method="post">
<div class="form-group">
<label>Comment</label>
<textarea name="business_comment" class="form-control" rows="2"></textarea>
</div>
<input type="text" name="bookId" id="bookId" hidden/>
<input type="text" name="agent_id" value="<?php echo $agent_id; ?>" hidden/>
<div class="checkbox m-t-lg">
<button type="submit" name="add_comment" class="btn btn-sm btn-success pull-right text-uc m-t-n-xs"><strong>Comment</strong></button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
</div>
<!-- /.modal-dialog -->
Hello... I want to pick the values from the modal especially the bookId value and use it in my php code. The value in the modal is set with the javascript code but Im having troubling retrieving it from the external php file. Please anyone help???