I am using a $_SESSION variable to send emails via AJAX (they need to be sent without refreshing the page), but the $_SESSION variable doesn't automatically update, so when it changes I need to refresh the page to update the variable.
Is it possible to update the $_SESSION variable without refreshing?
This is the code I'm using to send the email:
$(document).ready(function(){
$("#medicalembassy").validate({
debug: false,
rules: {
name: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "",
},
submitHandler: function(form) {
// do other stuff for a valid form
$.post('http://www.example.co.uk/erc/process.php?imei=<?php echo $_SESSION['imei2']; ?>&send_type=2', $("#medicalembassy").serialize(), function(data) {
$('#results').html(data);
});
}
});
});
So basically, if the $_SESSION variable changes, I need this AJAX email to recognise that without having to refresh.
Thanks for any help
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…