How to get HTTP REFERER value in Zend Framework

You can get that directly in Controller using the below code
     $requestUri    =    $this->getRequest()->getServer('HTTP_REFERER');
 If you want to get that outside of Controller you can use the Zend Front Contorller class
 $requestUri    =    Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();

How to get method name in controller while we try Zend JSON Service call

 You can use the below code in your controller to get the method name while you try jQuery.Zend.Jsonrpc service call

if($_SERVER['REQUEST_METHOD']    ==    'POST') {
            $data     =    json_decode(urldecode($this->getRequest()->getRawBody()));
            echo $data->method;
}

jQuery.Zend.jsonrpc returns error 'not a function' with cross domain request

There is a chance to retun 'not a function' error in console while we try the remote url.
 You can fix that with the following changes

  1. Use the latest jquery file
  2. Remove the 'content-type' attribute from jquery.zend.jsonrpc.js
  3. Add the property 'crossDomain: true' in jquery.zend.jsonrpc.js with ajax request
  4. Set the header("Access-Control-Allow-Origin: *") in your server script.
 
   I have followed the below url and updated the file with above condition then it works fine.
   http://sourcecodebean.com/archives/creating-a-json-rpc-service-using-zend-json-server/422

How to Reset all the values in Zend Form After Submit

   We can use the reset function to clear all the values in Zend Form
   Ex: $formObt->reset();

How to change Zend DB fetchAll() result Array to Object


 For that we need to use the setFetchMode function.

  Ex:  $stmt = $db->query('SELECT * FROM user');
       $stmt->setFetchMode(Zend_Db::FETCH_OBJ);
        $objs = $stmt->fetchAll();

How to to check mail delivery in Zend Framework

              $mail = new Zend_Mail();
                $mail->setBodyText('This is my test message');
                $mail->setFrom('info@cochinhub.com', 'From Name');
                $mail->addTo('sales@cochinhub.com', 'To Name');
                $mail->setSubject('Add subject here');
                try {
                    $mail->send();
                }catch (Zend_Exception $e){
                    echo $e->getMessage();
                }

How to connect MYSQL Database using Zend Framework

   require_once 'Zend/Db.php';
    $dbConnect = Zend_Db::factory("MYSQLI",
                    array(
                        "host" => "localhost",
                        "dbname" => "my_db",
                        "username" => "dbUserName",
                        "password" => "dbPassword")
    );