cakephp-1.2

A question about the Set() component in cakePHP

Hi all, I am using cakePHP 1.26. In a controller, I got a function: function testing(){ $userinfo=$this->Test->findAllByuser_id(); $this->set('userinfo',$userinfo); } I founf that the variable "userinfo" which contained some array data was only accessible in the testing.ctp. to make the variable "userinfo" accessible to other .ctp fi...

How to remove unwanted characters.

Hi, I am using cakephp 1.2. I am using httpsocket get method. It works well. But the content is enclosed by quotes.. string(123) "..this is where the content is". I think it is telling the type of response and the number of characters of the output. I have my application in production setup. How can i remove it. I appreciate any h...

how would you return two groups of Array data to be accessed by JQuery AJAX?

Hi all, I am learning cakePHP 1.26. and JQuery In a Controller, I got two an action with these lines of codes : function testing(){ $a = $this->User->findallByuser_id(1); $b = $this->User->Post->findallByuser_id(1); return a+b; // I was trying to return Array data $a and $b } how would you return two groups of Array data ($a and $b)...

Submit a URL as data in cakePHP

Hi all, I am using cakePHP 1.26. I got an Input Text box which contains a URL and I want to submit the URL and stored it in the Database using Jquery AJAX. Here is the HTML part: <input type="text" id="testing" value="http://stackoverflow.com/questions/ask"&gt; This is the JQuery part: var whatContent=$("#testing").val(); ...

What you would do to a URL that contains some special characters.

Hi all, I am using cakePHP 1.26 I got an Input Text box which contains a URL and I want to submit the URL and stored it in the Database using Jquery AJAX. Here is the HTML part: <input type="text" id="testing" value="http://stackoverflow.com/questions/ask"&gt; This is the JQuery part: var whatContent=$("#testing").val(); va...

Couldn't recieve any data using JQuery AJAX in cakePHP

Hi all, I am using cakePHP 1.26. I was trying to use JQuery AJAX to pass some sample data to a function in a Controller, but failed to do it. This is the JQuery Part: var w="helloworld"; var curl="http://localhost:8080/test/grab/"; $.ajax({ type: "POST", url: curl, data: "testing="+w, success: function(data) { al...

What value will be returned when a Table got updated?

Hi all, I am using cakePHP 1.26. I was trying to update a Table using these lines of code: $c = "helloworld"; $q="UPDATE user SET avatar='{$c}' WHERE user_id='999999'"; $result=$this->Test->User->query($q); if($result==true){echo "success";} else{echo "failed";} I noticed that the Table was updated successfully, but I still saw the ...

need some advice on my database design

Hi all, I am using cakePHP 1.26. I am going to build a very simple forum on localhost. Here is the conceptual design for the Database: Tables: User {user_id, name, date} Topic {post_id, title, content, date} Reply {post_id, content, date} Quote {quote_post_id, post_type, post_id} A User may have many Topic A User may have many Reply A...

savefield() created a new row or record rather than updating the specific record

Hi all, I am using cakePHP 1.26. I got some sample data in a Table which has got two field: {user_id, avatar} I was trying to update an old record in the database : $who=$this->Session->read('user.user_id'); // 12 was retrieved in this case $c = "http://www.abc.com/myimage.gif"; $this->Test->User->user_id = $who; $result = $this->T...

Changing the default login setup with CakePHP

I have something that I thought was a relatively common problem, but after researching the issue, it appears not to be as easy as thought. I have a CakePHP application (using version 1.2.7) and I am trying to change the standard login procedure using the Auth Component. I would like to use a persistent login screen ( like this Jquery p...

CakePHP 1.2.6 Login redirects to SSL but need to log in again

On a CakePHP 1.2.6 site, I performed the suggestions in http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session-handling-to-your-needs. The problem I'm running into is after logging in from http, the site refreshes back to the home page at https and does not show that I'm logged in. I need to log in again and then it works...

Redirection Loop in CakePHP Application

Hi, I am using CakePHP v1.2 for my web application hosted here: http://lol-land.in The application was working fine till Yesterday, but it suddenly started to get stuck in some redirection loops. What makes it weirder is the fact that the problem is with just one controller: posts. And even in that most of the functions are working. But...

How to Master/Slave switch, load balancing in CakePHP

I need to implement master/slave/load balancing into an existing site. Does anyone use these (or other) implementations for master/slave switching? The resources I found on how to implement master/slave into Cake:. (preferable) gamephase.net/posts/view/master-slave-datasource-behavior-cakephp bakery.cakephp.org/articles/view/master-...

Avoiding multiple instances of the same JS file.

I've found that loading the same javascript file twice or more (via PHP) can cause errors in IE (such as: line 1 char 1 code 0). This occurs when a webpage is constructed from nested templates - in this case, CakePHP. Is there a way to include a file only once? Perhaps, in CakePHP, it can be done by manipulating the $scripts_for_layou...

Are comments in CakePHP Code really even used/necessary?

Reading through the core and looking at nearly all of the helpers/plugins etc. that are available, I notice there are a lot of comments. CakePHP is structured in such a way that it is very simple to determine where things are and what they are doing. Is it really necessary to comment all of this code? Does it make the source more messy...

CakePHP 1.3 Plugin Shortcut Route

Hi, I searched a lot around the web but I couldn't find any specific sollution to this. In CakePHP 1.3, different from 1.2, if you had a controller inside a plugin, and both had the same name, you could access through "<plugin>/<action>", and it would call the 'default' controller. But in 1.3, according to this: http://cakeqs.org/eng/q...

Can we have Multiple Admin Routing in Cakephp ?

I want multiple admin routing.. One for Admin another for CLients.. is this possible. if not whats the best way to get around to this ? thanks a lot. ...

How do you capture the SQL queries running in a CakePHP page?

I have a production CakePHP site where I need to troubleshoot a slow SQL query. I want access to that great table CakePHP creates with the actual SQL query, execution time, etc, but I can't set the DEBUG level to 3 on a production site. I imagine this is a simple but I just can't seem to figure out how I can get this information for a s...

problem occures in if condition

I am tring to give condition, but it cant give appropriate result. like if($this->data['EmployeeExprienceDetail']['file_name']['type'] != 'image/jpeg') is this condition is ok or not...guide me thanks ...

problem displaying habtm relation of a specific user

Hi, I got 3 tables (Accessories, User, Accesories_Users)... At Accessories_Controller im trying just to get the accessories from the user logged in, so i set the recursive=1 and then execute the find... The problem is, if i do $this->Accessory->find("All", array('conditions'=>array('AccessoriesUser.user_id'=>$this->Auth->User('id'), ...