click to add info from one div to another and add to a session var via php
Im extremely new to jquery, ajax and the like, but have a basic understanding of it. As in I can build some stuff but minimally and when the functions start trailing off to more then one thing at a time I get lost a little. The PHP end of my line of thinking I will mention here I have no problems with, its just doing what I need to do with the jquery and ajax part thats got me upside down at the moment.
What I want to do is create a function that will post to php just a variable or two. With that variable I intend to add them to a session, for later use, I am also running it through PHP to check a couple things DB related to the variables in question. If everything is kosher then report back via ajax all is clear.
What I need to accomplish somehow is the return part of the ajax call, this is where I have a need to have multiple things happen at once, and this is my trip up. If php reports all clear. I need to make a function that will change the original link that was clicked from "Add" to "Remove" while changing the layout of the link to resemble the remove option rather than the Add, this link is contained within a div that has other info in it?
Is this link something I should put within another div in that div in a table-esk layout so it can change the attr of it without effecting the other info?
I need to also update another div based on the session currently when the page loads if the session is there i run it through a foreach based on the array. and have it echo out the results I need to do that without reloading the page, not sure how to make a div refresh with fresh content. The div is generally hidden until a user clicks on the button to make a pop up that works similar to the twitter login. This update of the div I speak of I just need to take the php session and rerun it through the foreach in essence but through ajax.
While thats going on I need to take another div find the numeric value and have it add/subtract that value base on how many values are in my session array. Ive seen all this done at once with other services I just havent a clue as to where to begin or how to properly do it.. Im not looking for someone to write me out a full concept as I do want to learn but if someone wouldnt mind helping me out by throwing me a start point that would be sweet.