0

I'm doing right now an php project. I want to do two actions with only one submit button, the button have to open two php pages. Thanks for your help

1
  • You can use javascript to do that Commented Apr 1, 2020 at 15:58

1 Answer 1

0

"Opening" pages is done by your browser - not by your php scripts. Therefore you need to do this on the client side. The most obvious way to achive this is with javascript. You can open a new tab/window by javascript as explained here:

JavaScript open in a new window, not tab

If this new page needs some data from your form too, you can send the form data as URL-Parameters (GET-request). Or as POST-request which is a bit more tricky with pure javascript:

POST Request (Javascript)

By using jQuery this will be much easier:

jQuery post request (not AJAX)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.