Jump to content

problem in passing variables in anchor tag


vish_haunted

Recommended Posts

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>

 

 

 

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.

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.