PHP echo message
<p>I am creating a online store Website at the moment I am working on Basket which is working.  I am trying to add a functionality which will echo a message once a user clicks the add button confirming that the item indeed has been added to basket.</p>

<p>I created a simple if statement that i believe should take care of this nicely but nothing is happening. No message is echoed. </p>

<p>code: </p>

<pre><code>if (isset($_GET['add'])){
    $quantity = mysql_query('SELECT product_id, product_qua FROM products WHERE product_id='.$_GET['add']);
    while($quantity_row = mysql_fetch_assoc($quantity)){
        if($quantity_row['product_qua'] !=$_SESSION['cart_'.$_GET['add']]){
            $_SESSION['cart_'.$_GET['add']]+='1'; 
        }
    }
}

if (isset($_GET['add'])){
    $basketMessage = "Item Sucesfully Added To Your Basket";
    echo $basketMessage;
}
</code></pre>

<p>Any suggestions...? </p>

<p>ANSWER:</p>

<p>OK forget the above code........</p>

<p>the belov code is code form a file where products are listed and then linked to cart.php the slice of code above:</p>

<p>code: </p>

<pre><code>while($get_row = mysql_fetch_assoc($get)){
    ?&gt;
        &lt;table id='display'&gt;
        &lt;tr&gt;&lt;td&gt;&lt;?php echo "&lt;img src=$get_row[$product_image] class='grow'&gt;" ?&gt;&lt;/td&gt;&lt;/tr&gt;

        &lt;tr&gt;
            &lt;th&gt;&lt;/th&gt;
            &lt;th&gt;&lt;strong&gt;Avalible&lt;/strong&gt;&lt;/th&gt;
            &lt;th&gt;&lt;strong&gt;Price&lt;/strong&gt;&lt;/th&gt;
            &lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
        &lt;td width='290px'&gt;&lt;?php echo "$get_row[$product_name]" ?&gt;&lt;/td&gt;
        &lt;td width='290px'&gt;&lt;?php echo "$get_row[$product_qua]" ?&gt;&lt;/td&gt;
        &lt;td width='290px'&gt;&lt;?php echo "&amp;pound $get_row[$product_price]" ?&gt;&lt;/td&gt;
        &lt;td width='290px'&gt;&lt;?php echo "$get_row[$product_des]" ?&gt;&lt;/td&gt;

        &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td&gt;&lt;?php echo '&lt;a href="cart.php?add='.$get_row['product_id'].'" onclick="return basketMessage()"&gt;Add&lt;/a&gt;';?&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;

    &lt;?php
        }
    }

    ?&gt;

&lt;script&gt;    
function basketMessage(){
      var confirmed = confirm("Add this item to Basket ?");
      return confirmed;
}
&lt;/script&gt;
</code></pre>

<p>OK as you can all see form the code I am looping the products database and listing some items that are assigned with the ADD button.....Now i added some javascript to this button to inform the user if this is the item they want to add to their basket</p>
