search

Home  >  Q&A  >  body text

html1-php-html2 value passing problem

html1 obtains the data filled in by the user, sends it to PHP for calculation and outputs json, and html2 reads the json and displays the data to the user.

Now I want the user to jump directly to html2 after submission. How to achieve this.

I know that AJAX can return to the current page html1, but how to let html2 get the data.

七月剑七月剑1690 days ago1247

reply all(2)I'll reply

  • Yang_Sir

    Yang_Sir2020-04-09 22:43:28

    If simple data is written directly in the url:

    echo "<script>window.location.href='html2.html?name=admin'</script>";

    Or save it in session

    reply
    1
  • 七月剑

    Well, thank you, solved. Also uses URL to pass parameters. html1 uses js to pass parameters to html2, and html2 uses ajax to directly interact with php after accepting the parameters.

    七月剑 · 2020-04-10 07:49:16
  • Cancelreply