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>

 

 

 

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.