Jump to content

newbie needs help


cspitzig

Recommended Posts

I am trying to create an order form that display database information and has an input field for the customer to indicates amounts, then send the arrays data to a confirmation page

 

I can't create the session array to port over to the 2nd page

 

can someone please review my code and give me some pointers on what I should be doing.

 

Code for Initial Page Start

 

for ($i = 0 ; $i < $rows ; $i++)  {

${"myrow$i"} = mysql_fetch_array($result);

echo "<tr>\n";

// echo "\t<td>".${"myrow$i"}["id"]."</td>\n";

echo "\t<td class=\"item\">".${"myrow$i"}["item"]."</td>\n";

echo "\t<td class=\"cost\">".${"myrow$i"}["cost"]." each</td>\n";

echo "\t<td class=\"amount\"><input type=\"text\" name=\"f_amount\" size=\"6\"></td>\n";

echo "</tr>\n";

 

if (!empty($f_amount)){

${"myrow$i"}[] = "$f_amount";

  $_SESSION['${"myrow$i"}'] = ${"myrow$i"};

// print_r (${"myrow$i"});

}

}

 

Code for initial page ends

 

Code for receiving page starts

 

if(!isset($_SESSION['${"myrow$i"}']))  {

    print 'array not working';

    }

    else {

print_r (${"myrow$i"});

}

 

Code for receiving page ends

 

any help would be greatly appreciated

 

Link to comment
https://forums.phpfreaks.com/topic/79040-newbie-needs-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.