Hi guys, I'm Alex. I'm a complete n00b to the world of PHP and am glad that y'all have support available here. :)
Anyway, I'm unofficially doing tech stuff for a magazine and I'm working on a code to order subscriptions. I'm having a problem with variables in a loop I'm using...
So I have a bunch of forms that are being generated from a loop, based on a number ($num) that a customer chooses (we're talking about shipping addresses). This form, with however many generated shipping addresses, is then sent through a payment processing script and upon verification (ideally), the script will send out $num of emails to our distributer containing the shipping information for each subscription.
I wrote the loop so the forms that it generates are called "Firstname1" and "Firstname2" for example.
My problem is, in writing the loop to be run post-positive-verification, can I have the PHP parse its own variables?
Something like this:
case "1":
for($i = 0; $i < $num; $i++) {
mail ("Alex@worthwhilemag.com","Worthwhile Subscription Purchase",
"A Worthwhile Subscription has been ordered for:
\n$firstname$i $lastname$i\n$address$i\n$city$i, $state$i $zip$i");
}
The double variables are what I feel is throwing me off. Anyone know if this is possible or I'm missing something?
I don't think I articulated this too well, btw...