Hi there guys,
on the form page, I generated a random 4 digit number. I then appended that number to the beginning of my html form elements, so:
using
$SESSION['AS_seed'] = mt_rand(1000, 9999);
$AS_seed = $SESSION['AS_seed'];
name='first_name' became name='3040first_name'
name='email' became name='3040email'
etc.
I got that part figured out just fine. My problem is when submitting the form, I don't know how to append the random number to the value 🙂
I am passing the number just fine, as I can print it to screen, I just don't know how to alter the following string:
$email = substr ($_POST['email'], 0, 100);
into
$email = substr ($_POST['3040email'], 0, 100);
I tried:
$email = ($_SESSION['AS_seed'].substr ($_POST['email'], 0, 100));
which prints just the random number
and
$email = substr (($_SESSION['AS_seed']).($_POST['3040email'], 0, 100);
which as I'm sure you can imagine went horribly 😉
how do I turn $POST['email'] into $POST['3040email'] , 3040 being the random number being held by $_SESSION['AS_seed'] ?
thanks,
json