Posted by J.O. Aho on 02/14/06 19:43
Joe wrote:
> I'm trying to find a solution for what is probably a very simple
> problem for an experienced PHP programmer.
>
> We are trying to move over a schedule to a web form. I think I am doing
> pretty well getting things together, tying it into a MySQL db and such,
> but the killer is that there are about 500 text area global variables
> that need to come from the entry form to the script for processing.
>
> So, I have about 500 $_POST['Shift_001'] (where 001 becomes 002,
> 003...478) variables that I need to place into a table after they've
> been filed out in the originating form. I've been able to pretty easily
> create the original form with iterations of the Shift suffix, but I'm
> just floundering trying to put together a way to use an iteration -- or
> any sort of 'automation' -- to write this $_POST['Shift_$i'] on the
> fly as TD in a new Table.
Try with $_POST["Shift_$i"]
if you use single quotes '' the string inside will be exactly as you typed it.
if you use double quotes "" the string will convert variables to the value
they contains. eg
$var="Something"
echo "$var\n"; //result: Something
echo '$var\n'; //result: $var
//Aho
[Back to original message]
|