First off, yes, i am a newbie and i apologize if this is a stupid questions. But, i can't find an answer anywhere.
I am trying to run a "for" loop that increments. Here is the code:
$seq_price = array( "1"=>395, "2"=>450, "3"=>300 ); //Sequence Pricing
$cha25_price = array( "1"=>155, "2"=>150, "3"=>100 ); //25 RXN Chariot Pricing
$cha100_price = array( "1"=>330, "2"=>240, "3"=>240 ); //100 RXN Chariot Pricing
$mod_price = array( "1"=>100, "2"=>120, "3"=>100 ); //Modification Pricing
$control_price = array( "1"=>100, "2"=>120, "3"=>100 ); //Extra Control Pricing
########################################################################
#SEQUENCE PRICING LOOP
########################################################################
for ($x=1; $x <= 10; $x++)
{
$seq="seq$x";
if ($$seq != "" ) //Price for sequence itself
{
$seqpr="seqpr$x";
($$seqpr = $seq_price["$cnum"]);
$mod="modpr$x";
if ($$mod != "none"){
$modpr="modpr$x";
$$modpr = $mod_price["$cnum"];
}
$cha="cha$x";
if ($cha == "25 rxns"){
$chapr="chapr$x";
$chapr = $cha25_price["$cnum"];
}
if ($cha == "100 rxns"){
$chapr = $cha100_price["$cnum"];
}
$septot="septot$x";
$$seqtot = ($$seqpr + $$modpr + $$chapr);
}
else
{
$seq="seq$x";
$$seq = 0;
$mod="modpr$x";
$$modpr = 0;
$cha="cha$x";
$$chapr = 0;
}
}
################
#NOTE: "cnum" is the country number defined by a hidden field in the form
################
Anyone have any clue why this does not work. Also is there a better way to define a variable so that it increments with each run of the loop?
Would appreciate any advice one can offer.

