Jump to content

PHP: POST displayed db $row from page to new page


scentofindie

Recommended Posts

Hi all.

 

I am having trouble using the Post/Get/Session method to send a displayed database row from a page to a new page. All the tut's seems to explain using input type=text.

 

i added a row called submit to the end of the form, which links to the new page.

but the data is not passing through.

 

i tried:

 

1. if(!isset...

2. $_SESSION ['order'] array ();

3. $Variable = $_POST['$Variable']

 

none works.

he'p!!!

if you would like to see the code, i can send it.

Thanks.

 

J.

 

 

no data is passing into the session variable from page to new page(form).

 

here is the code:

<?php
//
$result = mysql_query("SELECT * FROM `XXX`") 
or die(mysql_error());
echo "form name=\"order\" action=\iaoprocess.php\" method=\"post\">
echo "<table border=\"0\" width=\"900\" cellspacing=\"2\" cellpadding=\"2\">";
echo "<tr><th align='center'>IAO</th><th align='center'>IAO_ID</th><th align='center'>EXCHANGE</th><th align='center'>PRODUCT</th><th align='center'>CATEGORY</th><th align='center'>GENRE</th><th align='center'>RATING</th><th align='center'>PRICE</th><th align='center'>ARTIST</th><th align='center'>TITLE</th><th align='center'>UNITS</th><th align='center'>ISSUED</th><th align='center'>EXPIRES</th><th align='center'>PREVIEW</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td align=\'center\'>";
echo "<img src=\"http://soi360.com/member/images/iaotag.png\" width=\"25\" height=\"25\">";
echo "</td><td align=\'center\'>";
echo $row['IAO_ID'];
echo "</td><td align=\'center\'>"; 
echo $row['EXCHANGE'];
echo "</td><td align=\'center\'>"; 
echo $row['PRODUCT'];
echo "</td><td align=\'center\'>"; 
echo $row['CATEGORY'];
echo "</td><td align=\'center\'>";
echo $row['GENRE'];
echo "</td><td align=\'center\'>";
echo $row['RATING'];
echo "</td><td align=\'center\'>"; 
echo $row['PRICE'];
echo "</td><td align=\'center\'>"; 
echo $row['ARTIST'];
echo "</td><td align=\'center\'>"; 
echo $row['TITLE'];
echo "</td><td align=\'center\'>";
echo $row['UNITS'];
echo "</td><td align=\'center\'>";
echo $row['ISSUED'];
echo "</td><td align=\'center\'>";
echo $row['EXPIRES'];
echo "</td><td align=\'center\'>";
echo "<a href=\"http://soi360.com/IAO/$row[PREVIEW]\" title=\"Initial Artist Offering\">Preview</a>";
echo "</td><td align=\'center\'>";
echo "input type=\submit\" value=\"buy\" name=\"order\">";
echo "</td></tr>";
}

echo "</table>";
echo "</form>";
?>

 

This is the displayed db $rows

<?php

if(isset($_POST['order']))
{
$i_sub = $i_buy * $PRICE;
$i_fee = $i_sub * .10;
$i_total = $i_sub + $i_fee;
//
echo "<form action=\"iaoconfirm.php\" method=\"post\">";
echo "<table width=\"400\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">IAO ID</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['IAO_ID'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">PRODUCT</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['PRODUCT'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">CATEGORY</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['CATEGORY'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">GENRE</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['GENRE'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">RATING</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['RATING'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">PRICE</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['PRICE'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">ARTIST</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $_POST['ARTIST'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">TITLE</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $$_POST['TITLE'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">UNITS TO ORDER</div></th>";
echo "<td colspan=\"2\"><div align=\"left\"><input type=\"text\" name=\"i_buy\" value=\"10\"></div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\"></div></th>";
echo "<td colspan=\"2\"><div align=\"left\"></div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">SUB TOTAL</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $i_sub['i_sub'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">TRADE FEE</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $i_fee['i_fee'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">TOTAL</div></th>";
echo "<td colspan=\"2\"><div align=\"left\">"; echo $i_total['i_total'];"</div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\"></div></th>";
echo "<td colspan=\"2\"><div align=\"left\"></div></td></tr>";
echo "<tr><th width=\"200\" scope=\"row\"><div align=\"left\">PLACE ORDER</div></th>";
echo "<td colspan=\"2\"><div align=\"left\"><input type=\"button\" id=\"submit\" value=\"Place Order\"></div></td></tr>";
echo "</table>";
echo "</form";
}
?>

 

Thank you.

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.