How to pass div id and querystring through anchor tag link
When i click on link i have to show div.I am sending div id and query string value through anchor tag link.But,i am not getting the query string value.This is my code
<a href="#cart?product_name=<?php echo $row['product_name'];?>"></a>
In your qry string your using "$row['product_name']" and in the display your using "$_GET['product_name']". Which one isnt displaying? if the $row isnt showing, you need to post the code that is retrieving the "$row".
The value is coming dynamically.
The problem is that browsers won't reload a page when the user clicks on a link that begins with a named anchor (ie. <a href="#cart">). So no interaction with your query string ever occurs anywhere - either locally or on the server. You could try:
which would reload the page from the server with a proper query string, but I don't think you can mix a query string with a named anchor - at least not reliably across browsers.
<a href="<?php echo($_SERVER[PHP_SELF]); ?>?product_name=MyProduct">
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)