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

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

Which one?
#12

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

[eluser]mdowns[/eluser]
You need to check that the url is the same url you tried it manually.

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

[eluser]Nutan Lade[/eluser]
http://localhost/Gadgets/index.php/gadgets/addMovie/10

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

[eluser]mdowns[/eluser]
Can you explain more what is happening with the Ajax call then.
#16

[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
#17

[eluser]mdowns[/eluser]
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:
Code:
// Conventional PHP
$temp = $_POST['userId'];

// CodeIgniter Input class
$temp = $this->input->post('userId');
[/quote]
#18

[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.
#19

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

[eluser]mdowns[/eluser]
mysql_real_escape_string()
Read more here.




Theme © iAndrew 2016 - Forum software by © MyBB