Recent Posts

Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Tuesday, August 23, 2011

Cake PHP losing session in Google Chrome

I was having problem where i was losing my sessions and when i logged in as admin after every click i would have to login again.
After few searches i found out below article on pixelastic that was pretty helpful...

It might help you guys

losing-session-request-cakephp-chrome


Read more!

Wednesday, June 29, 2011

CakePHP: Auto populating foreign key dropdown fields

I wasted so much time figuring out to populate the drop down from foreign classes in cake PHP and wished it would be best if someone could have written from beginning to end to help the beginners of Cake like me.

Finally i figured it out and you guys can benefit from it.

I have two tables articles and users, user write articles so there is one to many relationship. I need user drop down in articles forms to say who is this user writing the article.

User table has
id
Name

Article table has
id
Title
user_id

So my Article Model will look like below:


My user model will look like below:


My Article Controller will look like below


The Add view will look like below:


Similarly Edit View will look like below


Hope this will help kick start your Cake Php learning ... enjoy coding


Read more!

Wednesday, June 22, 2011

OO database connection class in PHP

I got good OO database connectivity class for PHP tutorial in the following site:


Enjoy guys


Read more!