Jump to content

[SOLVED] click on image to submit to form


didgydont

Recommended Posts

hi all

i was just wondering how i can make it so when you click on the image it submits the item number to the item.php page

and instead of a button can i make the submit button just a link ?

<html>
<head>
<title>OLD WORLD</title>
<link rel="stylesheet" type="text/css" href="site.css" />

<body>

</head>

<body>
<?php

include("connect.php");
include("toolbar.php");
echo "<h1 ALIGN=\"center\">Old World Chandliers</h1>";

$result = mysql_query("SELECT * FROM stock");
// $result = mysql_query("SELECT * FROM stock WHERE itemnumber='$itemnumber'");


while($row = mysql_fetch_array($result))

  {
      $itemnumber = $row['itemnumber'];
  $name = $row['name'];
  $image = $row['image'];
  echo "<table border='0' ALIGN='center' cellpadding='5' cellspacing='0'><tr>";
  echo "<td><a href='$image'><img src='$image' alt='$name' width='200' height='170'></a>
</td><td><form action=\"item.php\" method=\"post\" width=\"200\">
  <input type=\"hidden\" name=\"itemnumber\" value=\"$itemnumber\">
  <input type=\"submit\" VALUE=\"$name\" class=namesbtn>
  </form></td></tr></table>";
  }


?>
</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/103100-solved-click-on-image-to-submit-to-form/
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.