I'm getting the question_id from db and I'm showing it in the input field. I want store that input value also in the $_SESSION.
How do I do this?
My code:
<div class="questionfun" onclick="return ChatLoginMax(event, <?php echo $chat_question_id; ?>);">
<a href="javascript:void(0);">
<p><?php echo $chat_question_title;?></p>
</a>
</div>
<input type="text" id="chatquestionId" name="chatquestionName" value="">
<?php
$_SESSION['session_name'] = $_GET['chat_question_id'];?>
Js:
function ChatLoginMax(event,chat_question_id){
$("#chatquestionId").val(chat_question_id);
}
$abc = "<script>document.getElementByID('chatquestionId').value</script>";should do ?$abcwill hold the specified string, not the value of theinput.. It is basics...PHPor useAJAX