I'm currently working on implementing AJAX for my website. Due to the large size of data, I need to use the POST method to send data to the database. However, I am facing an issue with fetching the POST variables in the test.asp file.
Below is the script I have been using:
function SaveData(content )
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
else
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var msg = xmlhttp.responseText;
alert(msg);
}
}
var para = encodeURIComponent("content="+content)
xmlhttp.open("POST","test.asp",true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
xmlhttp.send(para);
}
And here is the code in test.asp:
t = Request.form("content")
Response.write(t)
If anyone can help me solve the issue of fetching the POST method variable in test.asp, it would be greatly appreciated. Additionally, any assistance or example code using jQuery AJAX with the POST method in ASP classic would also be very helpful.