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

It's a bit difficult to follow, but if you are talking about not being able to retrieve values after the form shown in the "edit_what()" function is submitted, it's probably because your form is a "POST" form and so $_GET['id'] becomes $_POST['id']
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.