Jump to content

submit with xhttp


s_avinash_s

Recommended Posts

Well i don't know? everything done with AJAX coding would work in normal circumstance, so the problem lies with the board, unless you can identify how THE BOARD can read the ajax request and prevent loading the "other page", it will be difficult to come up with a viable solution.

With e.preventDefault(), it shouldn't go to the "other page", the form input names and values are sent through formdata NOT the form itself, sending to txt file does nothing!

Edited by dsonesuk
Link to comment
Share on other sites

IF you do not have a page with page document title 'Idex' and page title 'Mass flow' then it is creating one through the board with back button, and we can't do nothing about that! Its creating the html page and dumping what is coming from form data within it! else where could this document be coming from?

Edited by dsonesuk
Link to comment
Share on other sites

You are getting exactly what happens when you use

xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

you get this

 '-----------------------------1168277922115

Content-Disposition:_form-data;_name' => string '"jq"
1
-----------------------------1168277922115
Content-Disposition: form-data; name="jjq"
2
-----------------------------1168277922115
Content-Disposition: form-data; name="jqq"
3
-----------------------------1168277922115
Content-Disposition: form-data; name="ojq"
4
-----------------------------1168277922115--

without, you get just this

  'jq' => string '1' (length=1)
  'jjq' => string '2' (length=1)
  'jqq' => string '3' (length=1)
  'ojq' => string '4' (length=1)

Which is right! for your requirements?

Edited by dsonesuk
Link to comment
Share on other sites

Hi

1.Its nothing related to document title.But its related to only "/".

I mean when it is "ip/" it points to ip/index.htm.

 

2. If i use 

xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

or if don't use above line of code.

I get the following :

 '-----------------------------1168277922115

Content-Disposition:_form-data;_name' => string '"jq"
1
-----------------------------1168277922115
Content-Disposition: form-data; name="jjq"
2
-----------------------------1168277922115
Content-Disposition: form-data; name="jqq"
3
-----------------------------1168277922115
Content-Disposition: form-data; name="ojq"
4
-----------------------------1168277922115--

 

 

 

Link to comment
Share on other sites

1) IF that is a php file that shouldn't happen? if it is php, it might be a php caching problem, try clearing ALL history, session everything before running each.

2) just for a test, create an empty directory without anything in it, and point the url to that! What we are trying to do is send formdate() values that won't be picked up any present pages, this is what i seen from internet and here for standard form, unless all these directories have index file by default, or index file is created on recurving formdata()

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...