PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm having a bit of a head scratcher here, and wanted to see if one of you experienced PHP guys can help a mere infant of a PHP guy such as myself.
My problem is that I want to have a loop that will assign $_SESSION values by pulling $_POST values. I'm trying to loop through each with a FOR lop, but it won't recognize my embedded variables. Below is my code, and I'm just getting 0 for my $_SESSION values. Is there something wrong with my syntax?
I tried what you suggested but am still not getting any output. I have narrowed my problem and rewritten my code a little, so have a look at the new code:
Now I put in a PRINT command within the code to see what values were being output for the $_POST["quant_.$i"] type calls. I got no output for these. Though, when I manually wrote the number like $_POST[quant_1], I did get the correct output.
Is there some type of code of conduct for embedding variables within global arrays that I don't know about? Any help would be appreciated.