how topass value to controller??
- by rajesh
hi all,
actuallly when i trying to pass url value to controller action, action is not getting the required value...
i ma sending the value like this
function value(url,id)
{
alert(url);
document.getElementById('rating').innerHTML=id;
var params = 'artist='+id;
alert(params);
// var newurl='http://localhost/songs_full/public/eslresult/ratesong/userid/1/id/27';
var myAjax = new Ajax.Request(newurl,{method: 'post',parameters:params,onComplete: loadResponse});
//var myAjax = new Ajax.Request(url,{method:'POST',parameters:params,onComplete: load});
//alert(myAjax);
}
function load(http)
{
alert('success');
}
and in controller i hav write like
public function ratesongAction()
{
$user=$_POST['rating'];
echo $user;
$post= $this->getRequest()->getPost();
//echo $post;
$ratesongid= $this->_getParam('id');
but still not getting the result
i am using zend framework