Z
Z
Zikrillo Abbosov2020-04-19 15:10:45
PHP
Zikrillo Abbosov, 2020-04-19 15:10:45

How to submit a form to multiple PHP pages?

Here is the thing: There is a form

<form action="sign.php" method="post" name="form1" target="_self" class="container px-md-4 shadow">
<h1>Sign in</h1><hr>
<p>Your name<br><input name="name" type="text" size="20"></p><img src="./img/lock.svg">
<p>Your password<br><input name="pas" type="text" size="20"></p>
<p><input name="submit" type="submit" value="Send" class="btn btn-primary waves-effect waves-light"></p>
</form>

And now I need to send the form value to both sign.php and test.php

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton R., 2020-04-19
@anton_reut

Make the root script dispatcher.php which will "send out" using its functionality. And so - no way.
That is, first
<form action="dispatcher.php" method="post">
And then INSIDE dispatcher.php you already "send" the data by calling the necessary scripts.

R
Roman Sarvarov, 2020-04-19
@megakor

No, and it doesn't need to.
Submit the form and process it on the server in several ways, as you need.

L
LaraLover, 2020-04-19
@LaraLover

1. Ajax send data first to one file, then to the second.
2. Send in any way to one PHP file, and in this file make a request to the second script ( file_get_contents, curl or any other library like guzzle )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question