sova
November 26th, 2006, 10:20 AM
the code is a bit messy!!
but what i'm trying to do is how to get each button that is being created for each image in the database to get the same value as the image has.. so that when i click on each button the 'artikelNr' is retrieved and then inserted into a database (I haven't come that far yet)
I can get the right number if i click on the image, but not on the button..
My php scills arent to impressive so I could really do with some help!
while($row = mysql_fetch_array($result))
{
$thumb = $row['thumbnail'];
$nr = $row['artikelNr'];
echo ('<a href="' . $_SERVER['PHP_SELF'] . '?image=' . $thumb . '&artikelNr=' . $nr . '"><img src="'. $thumb. '" border="0"></a><br>');
//echo "<input type='hidden' value='$nr' name='myhidden'>";
echo "<input type='submit' value='add' name='mybutton'><br>";
}
if (isset($_POST['mybutton']))
{
$productid= $_POST['myhidden'];
echo $productid;
//echo $new_id ;
//echo $nr;
}
greatful for any help :-)
but what i'm trying to do is how to get each button that is being created for each image in the database to get the same value as the image has.. so that when i click on each button the 'artikelNr' is retrieved and then inserted into a database (I haven't come that far yet)
I can get the right number if i click on the image, but not on the button..
My php scills arent to impressive so I could really do with some help!
while($row = mysql_fetch_array($result))
{
$thumb = $row['thumbnail'];
$nr = $row['artikelNr'];
echo ('<a href="' . $_SERVER['PHP_SELF'] . '?image=' . $thumb . '&artikelNr=' . $nr . '"><img src="'. $thumb. '" border="0"></a><br>');
//echo "<input type='hidden' value='$nr' name='myhidden'>";
echo "<input type='submit' value='add' name='mybutton'><br>";
}
if (isset($_POST['mybutton']))
{
$productid= $_POST['myhidden'];
echo $productid;
//echo $new_id ;
//echo $nr;
}
greatful for any help :-)