954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Javascript Form Submit IE issue

Hello everybody:

This is my first thread in here. I readed a lot of good problems and solutions in this webpage. Right now im having troubles with one form submit in IE.

Here's the thing. I'm trying to generate a PDF in PHP, i'm using mPDF to show the html code with css. I sent through Post the hmtl code with a javascript form like this.

function exportPDF(prosjekt,url){
   var poststr4=new Array();
   poststr4["prosjekt"] = prosjekt;
   var html = openRepres(prosjekt);
   poststr4["html"]="<head></head><body>"+html+"</body>";

   //---------------POINT 1--------------//
   document.write(poststr4["html"]); 

   var method = "post"; 
   var form = document.createElement("form"); 
   form.setAttribute("method", method); 
   form.setAttribute("action", url); 
   for(var k in poststr4) { 
        var hiddenField = document.createElement("input");
        hiddenField.setAttribute("type", "hidden"); 
        hiddenField.setAttribute("name", k); 
        hiddenField.setAttribute("value", poststr4[k]);
        form.appendChild(hiddenField); 
    } 
    document.body.appendChild(form);
 
    //----------------POINT 2-----------//
    form.submit(); 

    document.body.removeChild(form);
}


In this code, when i show the code in POINT1 with document write, the table that i sent is in this way:

...

However, when i send the form to the URL in Point 2, the code that arrives is like this:

...

So what it does the form.submit is putting a slash in every " that is sent.

Why is this?The worst thing is that it hapenned to me after changing my server from Apache to IIS 6.0 (I dont like IIS, but is mandatory for the job)

Thank you!

thenanox
Newbie Poster
2 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

Ok i found the solution:

If someone see this, it is a setting in the php.ini. namely magic_quotes_gpc that should be disabled

restart the server and works:)

thenanox
Newbie Poster
2 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: