Submitting data to php via json

Submitting data to php via json

Hi guys ,

I have been trying for days to get an answers , here is my problem

I have a link :

  1. <a href="cart.php?id=2&rid=2&db=user" id="foobar"><img src="story.png"></a>

I want to submit this link to a php page which will process the page .

Below is the javascript that I am having a problem with :

  1.  $(".foobar").click(function () {
           
       
                $.ajax({
                    type:'GET',
                    url:'cart.php',
                    success:function(data) {
                        if(data=="Something") {
                            alert(1);
                        } else {
                            alert(0);
                        }  
                    }          
                });












  2. });

I have no idea how to pass these variables via json , also the variables are dynamic .


Please help I would really appreciate so help .


Thanks