473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Form submit IE Error

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.

Expand|Select|Wrap|Line Numbers
  1. function exportPDF(prosjekt,url){
  2.    var poststr4=new Array();
  3.    poststr4["prosjekt"] = prosjekt;
  4.    var html = openRepres(prosjekt);
  5.    poststr4["html"]="<head></head><body>"+html+"</body>";
  6.  
  7.    //---------------POINT 1--------------//
  8.    document.write(poststr4["html"]); 
  9.  
  10.    var method = "post"; 
  11.    var form = document.createElement("form"); 
  12.    form.setAttribute("method", method); 
  13.    form.setAttribute("action", url); 
  14.    for(var k in poststr4) { 
  15.         var hiddenField = document.createElement("input");
  16.         hiddenField.setAttribute("type", "hidden"); 
  17.         hiddenField.setAttribute("name", k); 
  18.         hiddenField.setAttribute("value", poststr4[k]);
  19.         form.appendChild(hiddenField); 
  20.     } 
  21.     document.body.appendChild(form);
  22.  
  23.     //----------------POINT 2-----------//
  24.     form.submit(); 
  25.  
  26.     document.body.removeChild(form);
  27. }
In this code, when i show the code in POINT1 with document write, the table that i sent is in this way:

<table border="1" class="wind">...

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

<table border=\"1\" class=\"wind\">...

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!
Jul 23 '10 #1

✓ answered by Dormilich

Why is this?
that’s a setting in your php.ini. namely magic_quotes_gpc. if that should be disabled, either the server or IE is applying the backslashes. easiest workaround for that: stripslashes().

4 2157
Dormilich
8,658 Expert Mod 8TB
Why is this?
that’s a setting in your php.ini. namely magic_quotes_gpc. if that should be disabled, either the server or IE is applying the backslashes. easiest workaround for that: stripslashes().
Jul 23 '10 #2
@Dormilich
ok, i changed the PHP.ini putting off that attribute, restarted the server and now works perfect:)

REALLY thank you, i was really anoyed searching for the solution
Jul 23 '10 #3
Dormilich
8,658 Expert Mod 8TB
Note: magic_quotes_gpc is deprecated as of PHP 5.3.0 and will be removed in PHP 6.
Jul 23 '10 #4
@Dormilich
good to know, because it was a headache this morning for me:P

Thank you
Jul 23 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tony Hedge | last post by:
Hello, I hope some one can answer this for me. I am using .NET version 1.0 on Windows 2000Pro and I am getting an error when doing a form submit from an HTML control. Please look at the...
3
by: David Gonneau | last post by:
I'm getting an incredible behaviour of internet explorer. I have a generated html page with one form and many input of checkbox type. Those checkbox are grouped in 4 lists and each list of...
4
by: Bradley Kite | last post by:
Hi all. I'm trying to diagnose/solve a problem with internet explorer, whereby sometimes the form submits, and other times IE produces an 'invalid syntax' error. First, I have a form, and...
8
by: shandain | last post by:
Ok, I have done this a million times, and I can't get this to work... I hope I am just being an idiot and missing something... but I can't see it... so please call me an idiot and tell me what it...
0
by: Alvin Bruney | last post by:
When i submit a form from the client side using document.all.RateManForm.submit(); in the code behind, changing text in a text box or trying to prompt the user with a...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
3
by: Xerxes | last post by:
Hi, I am trying to submit a form when a non-submit button is clicked! I have: <input name="add_dev" type="button" value="Add Device" onClick=" this.form.action='<?php echo $_SERVER?>';...
1
by: rwelchman | last post by:
Hi, I have a problem with a submit form in that it does not submit(error message), I think because there is another form on the page whose action is to work out various inputted variables and give...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
4
by: szimek | last post by:
Hi, I've already posted an email with this problem, but this time I think I got a bit more info. The app I'm currently working on works like this: when user clicks on a clickable element, it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.