Here is a simple example of how to pass a PHP variable from one page to another with the post method
Code:
<form method="post" action="array_script.php">
0.<br/>
<input type="text" name="first_name0"/><br/><br/>
1.<br/>
<input type="text" name="first_name1"/><br/><br/>
2.<br/>
<input type="text" name="first_name2"/><br/><br/>
3.<br/>
<input type="text" name="first_name3"/><br/><br/>
4.<br/>
<input type="text" name="first_name4"/><br/><br/>
<input type="submit" name="submit"/> </form>
Values sent to the server corresponding to "first_name0" through " first_name4" will each occupy its' own space in the $_POST super global array. Now, let's write a piece of code on how to get those variables from the server to my script "array_script.php."
Code:
<?php
$first_name0 = $_POST['first_name0'];
$first_name1 = $_POST['first_name1'];
$first_name2 = $_POST['first_name2'];
$first_name3 = $_POST['first_name3'];
$first_name4 = $_POST['first_name4'];
?>
Bookmarks