Jump to content

Jquery each() results to array to php to database


shortysbest

Recommended Posts

Basically what I am doing is making a sort of invitation system, the user clicks on users and they go into a list,  that all works, I can get the ids of them using each() but I need to pass it through Jquery Ajax to php to send it to the database for notifications. This is basically what I have:

 

$(".group-video-create").click(function(){
var url = $(".group-input-url").val();										
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
var checked_url = url.match(exp,"<a href='$1'>$1</a>"); 
if(checked_url)
{	
$("#group-input-names li").each(function(){	 //////This is the relevant code/////
var user_id = $(this).attr("id");			   ///////////////////Here too///
});	//////////////////& here

if(user_id)
{

$.ajax({
type: "POST",
//url: "",
//data: "", //this would be an array of all of the ids, (could be 1, could be 100).
cache: false,
success: function(html){
///Once all invitations have been sent to the database it would then load a new div and hide the previous one. 

	}


});
}
}
});

 

if you want to see what I'm trying to accomplish just go here:

 

http://www.kithell.com/#/video

 

usr: [email protected]

pass: phpfreaklogin

 

it's under Group Video. (You should be automatically directed there once logged in)

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.