View Full Version : single quote issue

11-03-2008, 10:16 AM
ajaxRequest.open("GET", "scr/scr_edit.php?str="+str, true);

on my local server i get this on the php page "<p>\'test\'</p>" but only my live sever i get this "<p>'test'</p>". i dont understand why it is different and it is a problem for "sql input text tidy up function" i now have to check what sever im on etc.

anyone have any thoughts/ideas? its more annoying than anything to be honest.

11-03-2008, 07:58 PM
You need to be more speciffic, nobody will understand what you're asking from your post. What code are you running?

11-04-2008, 04:18 PM
function saveEdit(){
var ajaxRequest; // The variable that makes Ajax possible!
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
// alert('Opera 8.0+, Firefox, Safari');
}catch (e){
// Internet Explorer Browsers
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
}catch (e) {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
// Create a function that will receive data
// sent from the server and will update
// div section in the same page.
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
if(ajaxRequest.status == 200) {
// ajaxDisplay.innerHTML = ajaxRequest.responseText;
}else {
ajaxDisplay.innerHTML = ajaxRequest.status;
//document.ajax.dyn="Error code " + xhr.status;
var str=document.getElementById('str').value;
ajaxRequest.open("GET", "scr/scr_edit.php?str="+str, true);

basically what i am saying is $_GET['str']="<p>\'test\'</p>" on one server and $_GET['str']="<p>'test'</p>", where the input field contains "<p>'test'</p>" on both. a back-slash is prefixed to the ' on one server and not the other.

echo $_GET["str"];

it isnt a problem i can't overcome, i just dont understand why its happening.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum