vish_haunted Posted February 20, 2012 Share Posted February 20, 2012 what is the problem in this code <div id="product"> <a class='inline' href="?prod=<?php echo $row['id'];?>#<?php echo $row['id']; ?>" > ..... </a> </div> <div style='display:none'> <div id='<?php echo $row['id'];?>'> .... </div> </div> $prod=$_GET['prod']; echo "the value of prod".$prod; $_SESSION['cart']=$prod; <script> $(document).ready(function(){ //Examples of how to assign the ColorBox event to elements $(".inline").colorbox({inline:true}); }); </script> Link to comment https://forums.phpfreaks.com/topic/257364-problem-in-passing-variables-in-anchor-tag/ Share on other sites More sharing options...
trq Posted February 20, 2012 Share Posted February 20, 2012 Why don't you describe the problem your having? Link to comment https://forums.phpfreaks.com/topic/257364-problem-in-passing-variables-in-anchor-tag/#findComment-1319132 Share on other sites More sharing options...
vish_haunted Posted February 20, 2012 Author Share Posted February 20, 2012 the variable '$prod' doesn't receive any value when the link is clicked. Link to comment https://forums.phpfreaks.com/topic/257364-problem-in-passing-variables-in-anchor-tag/#findComment-1319139 Share on other sites More sharing options...
trq Posted February 20, 2012 Share Posted February 20, 2012 Where is $row['id'] defined? Link to comment https://forums.phpfreaks.com/topic/257364-problem-in-passing-variables-in-anchor-tag/#findComment-1319140 Share on other sites More sharing options...
vish_haunted Posted February 20, 2012 Author Share Posted February 20, 2012 i'v not shown the database connection here. When the anchor is <a class='inline' href="#<?php echo $row['id']; ?>" > it works fine. I want to pass variable from above link so i can store it in session. But when anchor is <a class='inline' href="?prod=<?php echo $row['id'];?>#<?php echo $row['id']; ?>" > it doesn't work. Link to comment https://forums.phpfreaks.com/topic/257364-problem-in-passing-variables-in-anchor-tag/#findComment-1319150 Share on other sites More sharing options...
trq Posted February 20, 2012 Share Posted February 20, 2012 Cool. We need to see more code. Link to comment https://forums.phpfreaks.com/topic/257364-problem-in-passing-variables-in-anchor-tag/#findComment-1319158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.