Welcome Guest, Not a member yet? Register   Sign In
Ajax Request

[quote author="Nutan Lade" date="1219781044"]I am using Ajax library.[/quote]

Which one?

[eluser]Nutan Lade[/eluser]
In Ajax for CI.
prototype.js library I am using.

You need to check that the url is the same url you tried it manually.

var url = "<?=base_url()?>index.php/gadgets/addMovie/"+movieId;

[eluser]Nutan Lade[/eluser]

this was the url I tried manually and the value i got is addMovie

Can you explain more what is happening with the Ajax call then.

[eluser]Nutan Lade[/eluser]
Here in the Ajax call I am sending a value userId.I need this value to enter into db.But when I am using $_post['userId'] I am getting an error and it is

Undefined index: userId

Try one of these (note $_POST instead of $_post):
[quote author="inparo" date="1219696545"]They'll be in the $_POST array, so you have two options:
// Conventional PHP
$temp = $_POST['userId'];

// CodeIgniter Input class
$temp = $this->input->post('userId');

[eluser]Nutan Lade[/eluser]
Sorry dude thanks for ur help and suggestions.But it was returning null value only.So now I am changing the code and sending the value through url only.Although it is not good to do but I am doing it.

[eluser]Nutan Lade[/eluser]
can u tell me how to remove single quotes etc before inserting values into db.

Read more here.

Theme © iAndrew 2016 - Forum software by © MyBB