hi, i'm having trouble to understand how this php works, i wrote php to give me an options whether to delete or not, please see in php code

PHP Code:

if (isset($_GET['yesdelete'])) {

$id_to_delete $_GET['yesdelete'];
    if (
$id_to_delete $sql->query("DELETE FROM product WHERE product_id='$id_to_delete' LIMIT 1"))

$pictodelete = ("product_images/$id_to_delete.jpg");
    if (
file_exists($pictodelete)) {
header("location: product-copy-4.php"); 
if (isset(
$_GET['nodelete'])) {

$id_to_delete $_GET['nodelete'];
header("item.php?pid=' . $product_id . '"); 
and in body i wrote

HTML Code:
<td width="12%" align="center"><input type="submit" name="Delete" id="Delete" value="Delete" />
      <?php '<a href="item.php?yesdelete=' . $_GET['deleteid'] . '"></a>'?> 
      <td width="35%"><input type="submit" name="Cancel" id="Cancel" value="Cancel" />
      <?php '<a href="item.php?nodelete=' . $_GET['deleteid'] . '"> </a>'?></td>

but the problem is that is not sending single to php to delete it. what did i missed!