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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.