cspitzig Posted November 27, 2007 Share Posted November 27, 2007 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 Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 27, 2007 Share Posted November 27, 2007 You need to be calling session_start() at the beginning of your pages. Please use [.code][./code] tags next time, without the dots. Quote Link to comment Share on other sites More sharing options...
cspitzig Posted November 27, 2007 Author Share Posted November 27, 2007 hello I do have session_start in the header section of the file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.