Jump to content

Passing values


tet3828

Recommended Posts

I am unable to retrieve the data that is sopposed to be posted by these forms.... any suggestions of why this is happening?

function edit_what () {

echo "Which value would you like to edit? <br />";
echo "<form method='post' action='{$_SERVER['PHP_SELF']}'>";
echo "<input type='hidden' name='id'  value='{$_GET['id']}'>";
echo "<input type='radio' name='edit' value='itemName'> Edit Name <br>";
echo "<input type='radio' name='edit' value='itemDesc'> Edit Description<br />";
echo "<input type='radio' name='edit' value='itemPrice'> Edit Price <br />";
echo "<input type='radio' name='edit' value='itemAvil'> Edit Avialibilty<br />";
echo "<input type=submit name=submit value=Submit /></form>";

}
Link to comment
https://forums.phpfreaks.com/topic/26163-passing-values/
Share on other sites

function display_item () {


$id = $_GET['id'];
$qry = "SELECT itemName,itemCat,itemSub,itemId,itemAvil,itemPrice,itemDesc,itemSmall FROM `products` WHERE `itemId`=\"$id\"";
$result = mysql_query($qry) or die(mysql_error());

echo "Listed below is the stored data for the item #$id <br />
Use the fields below the item table to modify the information.";

while($row = mysql_fetch_array($result))
{

echo "<table border=\"1\"><tr><td>".$row['itemName']."<td>Item ID# ".$row['itemId']."</td></td></tr>";
echo "<tr><td><img src=\"".$row['itemSmall']."\" /></td><td valign=top width=150>Description:
".$row['itemDesc']."</td>";
echo "</tr><tr><td>Price: $".$row['itemPrice']."</td><td>Avilibility: ".$row['itemAvil']." </td></tr>";
echo "<tr><td width=150>Catagory: ".$row['itemCat']."</td><td width=150>Sub-Catagory:".$row['itemSub']."</td></tr>";
}
echo "</table>";

}
Link to comment
https://forums.phpfreaks.com/topic/26163-passing-values/#findComment-119657
Share on other sites

[quote author=tet3828 link=topic=113841.msg462936#msg462936 date=1162666582]
I am unable to retrieve the data that is sopposed to be posted by these forms.... any suggestions of why this is happening?

function edit_what () {

echo "Which value would you like to edit? <br />";
echo "<form method='post' action='{$_SERVER['PHP_SELF']}'>";
echo "<input type='hidden' name='id'  value='{$_GET['id']}'>";
echo "<input type='radio' name='edit' value='itemName'> Edit Name <br>";
echo "<input type='radio' name='edit' value='itemDesc'> Edit Description<br />";
echo "<input type='radio' name='edit' value='itemPrice'> Edit Price <br />";
echo "<input type='radio' name='edit' value='itemAvil'> Edit Avialibilty<br />";
echo "<input type=submit name=submit value=Submit /></form>";

}
[/quote]
Link to comment
https://forums.phpfreaks.com/topic/26163-passing-values/#findComment-119701
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.