0

i have 2 php files named as A.php and B.php. i need to send same data values in javascript at A.php to B.php, simple i am using below post array for that.

$.post('B.php', {sendlat: sendlat, sendlng: sendlng});

but when i sending the data to the B.php. once sending has complete i need to open the B.php file and display the posted data on the page.

can is use the session i hope no? any possible method ?

i have tried to use below method to load the file, it happened but i cant receive the data from the post array?

  window.location = "B.php";

kindly give me a suggestion, am so appreciate if you can give me a coding example for this.

thank you chamath

Chamath Gunasekara
  • 129
  • 1
  • 2
  • 11

1 Answers1

-2

The point of Ajax is to make an HTTP request without leaving the page.

If you want to navigate to the page you get as a result of making the POST request: Don't use Ajax.

Just use a regular form submission instead.

You can generate the form from JS DOM manipulation and call its submit() method if you want to do this programatically.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335