I have an AJAX function on a View page that refers to a PHP script. This script is placed inside the public/php folder and it looks like this:
Code:
<?php
require_once('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Json');
Zend_Loader::loadClass('Zend_Db_Table');
Zend_Loader::loadClass('Users');
$values = array(
'firstname' => $_GET['firstname'],
'lastname' => $_GET['lastname']
);
$users = new Users();
$users->insert($values);
echo Zend_Json::encode($values, Zend_Json::TYPE_OBJECT);
When i try to instantiate the Users class, which is a model inside the application/models folder, it does not work. It does not even reach the insert statement. When i remove those 2 statements i do get a JSON reply from the script. Can anybody help me with this and tell me what i am doing wrong. If this is not the correct wat to go about things in the Zend Framework i would love to hear the correct wat, i searched a lot but i cannot seem to find it.