shortysbest Posted April 28, 2011 Share Posted April 28, 2011 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: PhpFreak@yahoo.com pass: phpfreaklogin it's under Group Video. (You should be automatically directed there once logged in) Quote Link to comment https://forums.phpfreaks.com/topic/235041-jquery-each-results-to-array-to-php-to-database/ Share on other sites More sharing options...
shortysbest Posted April 29, 2011 Author Share Posted April 29, 2011 Quote Link to comment https://forums.phpfreaks.com/topic/235041-jquery-each-results-to-array-to-php-to-database/#findComment-1208279 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.