Hello, all. Please advise how to use $_POST in cycle. I have the following code:
- <?php
- if (isset($_POST['id1'])) {$id1 = $_POST['id1']}
- if (isset($_POST['id2'])) {$id2 = $_POST['id2']}
- if (isset($_POST['id3'])) {$id3 = $_POST['id3']}
- ?>
I have tried:
- <?php
- for ($x=1, $x<=3, $x++)
- {
- if (isset($_POST['id".$x."'])) {$id".$x." = $_POST['id".$x."'];}
- }
- ?>
...but it doesn't work. :(