Я хочу передать данные form1 из file1.php в file3.php, затем перейти к file2.php с новой form2 и затем передать данные из form2 в file3.php.Тем не менее, до сих пор у меня есть только данные из form2 в file3, но я не знаю, как передать или получить данные из form1 (file1.php).
file1.php с моими данными form1
<form method="post" name="cartForm" action="file2.php?act=form">
<div class="card-group">
<div class="card">
<img class="card-img-top" src="./images/10-11017B.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Basic Black Polo</h5>
<p class="card-text">Word on the street is that 'black is the new black.'</p>
</div>
<div class="card-footer text-muted">
<label class="card-text">Amount</label>
<input type="number" step="1" value="1" class="form-control amount-input" name="amountProd1">
<label class="card-text">Price</label>
<input type="number" step="1" value="30" class="form-control amount-input" name="priceProd1">
</div>
</div>
</div>
<div class="checkout-button">
<input type="submit" name="submit" class="btn btn-secondary" value="Checkout" />
</div>
</form>
file2.php с данными form2 (Здесь у меня есть данные из формы 1 - amountProd1)
<?php
print_r($_POST['amountProd1']); // 1 is printed here
?>
<!-- end php code -->
<div class="container">
<div>
<form method="post" name="addressForm" action="file3.php?act=form">
<div class="form-group">
<label for="firstname">Firstname</label>
<input type="text" class="form-control" name="firstname" id="firstname">
</div>
<div class="checkout-button">
<input type="submit" name="submit" class="btn btn-secondary" value="Continue" />
</div>
</form>
</div>
</div>
file3.php, где у меня есть данные form2 из file2.php, но я нетбольше нет данных из формы 1 из file1.php:
<?php
print_r($_POST['amountProd1']); // nothing is printed here
?>
<!-- end php code -->
<div class="container">
<div>
<form method="post" name="paymentForm" action="file4.php?act=form">
<div class="form-group">
<label for="payment">Payment</label>
<input type="text" class="form-control" name="payment" id="payment">
</div>
<div class="checkout-button">
<input type="submit" name="submit" class="btn btn-secondary" value="Continue" />
</div>
</form>
</div>
</div>
Может кто-нибудь сказать мне, как передать данные формы1 в файл2, чтобы я мог получить к ним доступ в файле3?