Here is a section of my code:
The problem I have is that sometimes the message will contain URL's which may be in the format: "
They are then sent to the php script in the format: "script.php?message=
However the script reads this format like:
script.php
?
message=&
key2=value2
Instead of:
script.php
?
message=
key2=value2 is no longer part of message.
I have tried replacing xhr.open("GET",url,false); with xhr.open("POST",url,false); assuming this would have fixed the problem, however message is not sent to the php script. Can this be fixed in the javascript or is this a php issue?
Any help will be much appreciated.
Thanks,
Chris
Code:
function fAccess() {
var message=document.getElementById('message').value;
document.getElementById('message').value = "";
document.getElementById('message').focus();
var url="bottom_execute.pl?Message="+message+"&Random="+Math.random();
xhr.open("GET",url,false);
xhr.send(null);
document.getElementById("DisplayA").innerHTML=xhr.responseText;
}
The problem I have is that sometimes the message will contain URL's which may be in the format: "
They are then sent to the php script in the format: "script.php?message=
However the script reads this format like:
script.php
?
message=&
key2=value2
Instead of:
script.php
?
message=
key2=value2 is no longer part of message.
I have tried replacing xhr.open("GET",url,false); with xhr.open("POST",url,false); assuming this would have fixed the problem, however message is not sent to the php script. Can this be fixed in the javascript or is this a php issue?
Any help will be much appreciated.
Thanks,
Chris