cakephp

Logical Column in MySQL - How?

I have a datamodel, let's say: invoices (m:n) invoice_items and currently I store the invoice total, calculated in PHP by totalling invoice_items, in a column in invoices. I don't like storing derived data as it paves the way for errors later. How can I create a logical column in the invoices table in MySql? Is this something I would be...

Simultaneous ajax requests

am trying to run the remote function in the code below every 5 seconds, but it runs only once if i remove the frequency option. So i tried remoteTimer function, but when i use remoteTimer function, some code of the script goes outside the script tags and i see that in the webpage.. echo $ajax->form(array('type' => 'post', 'options' => a...

Encrypt/Decrypt Form Fields auto in Cake PHP

Hey, I was just wondering how to decrypt/encrypt form data in cakephp by creating a behavior? What I have so far: $key = Configure::read('Security.cipherSeed'); Security::cipher($encrypt,$key) debug($key); function encrypt { var $autoEncrypt= 'true';} function decrypt {} Other than this I really could use some help. ...

Why can't I reference this array index that seems to exist?

I'm getting a return string from a merchant account that looks like: RecurringID=8675309&RefNo=41:39&Notes= so I parse it into an array like this: $results = array(); $temp = explode('&', $temp); foreach($temp as $line) { $line = explode('=', $line); $results[trim($line[0])] = trim($line[1]); } The resulting print_r($result...

calling remote folder in div ?

Hi i have to call localhost cakephp made pages using jquery in my another cakephp folder page in div.please suggest any example so that it will be easy to do that. thanks ...

custom cakephp error messages not showing

I have created a custom page for error messages in my web application. I have created these two files in the views/errors/ directory named 'missing_action.ctp' and 'missing_controller.ctp'. On server the error message is shown as follows: and on localhost the error is shown properly like as follows: I want to show the error messag...

Facing problems in fetching the data from php web services installed in cake-php from iphone.

Hi everybody! I'm new to php and have zero exprience with the cake-php. I created the php web services, which reads data from MySql and return to my iphone app. Previously I used the same code successfully in many app, But now I'm facing the problems in it. Because the web server on which I installed my web services is cake-php based. wh...

Duplicate entry when trying to edit a record

When i try to a edit a entry.. its creating a duplicate entry in the database. i have made sure i add an hidden id field when i go to the edit form. Restaurant RestaurantAttribute RestaurantContact these are the models i am using. tried reinitialize the id $this->Restaurant->id = $this->Restaurant->id; strange... in the db the ex...

[CakePHP] Ampersand in URL

hi all, i'm developing cakephp application. i need some specific characters in url, like & (ampersand), because i need it for search purpose. but, if i have ampersand in my url (like http://localhost/myapp/publications/index/string:Mono%20Manana/tags:publisher), it is rewrited and redirected as default url (in this case http://localho...

File Upload Failing Mysteriously in CakePHP

I'm trying to upload a file to my server using the CakePHP file upload form helper. I am currently running CakePHP 1.3 on my development computer (Mac OSX). When the form submits, it has in the variables that are passed to the controller its temp name: /var/tmp/name and then its name as the name of the file. However, when I try to rename...

How do I sidestep CakePHP to write to specific folders?

I'm trying to upload files into a folder, but it keeps failing and I think CakePHP is taking over the write and try to process it as a Controller. Is this true? And if so, how can I sidestep it? ...

naming tables in cakephp

Hi In my app I have 2 tables that have a many to many relationship. Let us say these are table students and table courses. Each course can have many students and each student can also enroll in many courses. Now I want to create a associative table which according to cakephp should be named courses_students. However for various reason...

cakephp .htaccess configuration on godaddy with subdomain

Hello All, I have one domain on godaddy (www.mydomain.com). I have placed my cakephp application on this domain. It is working fine for me. But i have created a subdomain blog.mydomain.com for this godaddy has created a directory named blog inside the www.mydomain.com now how can i redirect the request coming for blog.mydomain.com to ...

cakephp ftp ???

Is there anyway to upload files to an ftp server using cakephp? ...

CakePHP: is it possible to use model data in layouts?

I would like to display a ticker on each page what scrolls some of the latest datas in it. I think to put in the layout file would be more simply if I can read the model data from the layout. Is it possible? Or does layout code has access to the variables generated by a controller and passed to a view? Or is it the only way to make an ...

Cakephp - Having Issue when submitting form to plugin controller action

I am a 3+ years old in cakephp and facing a somewhat strange issue with submitting a form to plugin controller's action (i am using plugin first time). After trying different known things i am posting this one. Going straight into the matter here is the form in my "forum" plugin's search_controller.php's "index" view: echo $form->creat...

Possible stupid question about CakePHP's $this->data

I have an application the is loaded with forms in every view. I've become rather familiar with CakePHP's array syntax and I use the $this->data parameter a lot. I fell in love with skinny controllers and fat models, so I put as much code in my models as is possible. Unless I'm doing something complex, most of my controller methods loo...

How to use the cakePHP built-in FORM helper to generate Text and Hidden text boxes

Hi all, I am using cakePHP 1.26. I am sorry to ask this question, but I couldn't work out how to use the cakePHP built-in FORM helper to generate the code like these two: <input type="text" name="data[Test][quote]" id="data[Test][quote]" size="12" style="font-family:Arial" value="helloworld" readonly> <input type="hidden" name="data[...

Redirect user to the page which he has just added a new reply.

Hi all, I am using cakePHP and is making a very simple message board. I came across a question, and I have no idea how to solve it: Let say there were ten records in the Table Reply, and a user has just successfully made a new reply to the Table. So there are eleven records now. After the new record is made, I use this to redirect the ...

How do I add an onChange event to select tag in CakePHP?

I am trying to use AJAX to populate some select boxes that were autogenerated using CakePHP's formHelper. How do I add the onChange event listener to the select box? ...