Hello I am using codeigniter framework for my college project ,and I need to call controllers method from js function, and i manage to do that, but now I dont know how to pass data to that method that I am calling. I was found some examples on web but I didn't manage to solve my problem.
This is how I call my method from js function,
window.location.href = "<?php echo site_url('controller_user/test');?>";
and I need to send this data to that method
var data = [formName, formSurname, formEmail, formUsername];
And I try something like this:
window.location.href = "<?php echo site_url('controller_user/test');?>?data="+data;
I don't know what to do to solve this problem, like I said I found something similar on stackoverflow site but still having trouble.
Thanks to everyone willing to help me!!!