Local Domain Name in Windows

Uncategorized No Comments »

This a simple tutorial on how to create a local domain name in windows using Apache.

First go to C:\Windows\System32\drivers\etc and edit the hosts file using notepad
Second add this inside the hosts file 127.0.0.1 www.yourdomain.com
Third go to your apache\conf\extra and edit httpd-vhosts.conf and add the text below


DocumentRoot “C:\xampp\htdocs\your_web_app_folder”
ServerName www.yourdomain.com

Next go to apache\conf and uncomment Include conf/extra/httpd-vhosts.conf

Save everything and restart Apache

Then try to access http://www.yourdomain.com

Neat functions in CakePHP

CakePHP, CakePHP 1.2 No Comments »

Just recently learned a neat function in CakePHP.

If ever you want to remove a validation temporarily for certain fields

you can use unset before saving the data

unset($model->validates['fieldname']);

I also learned also another function to know what field validation I

violated especially when your updating your records because sometimes

it does not show the validation errors I use debug to display it

if(!$this->save())

{

debug($this->validationErrors);

die();

}

Using CakePHP with IIS7

CakePHP No Comments »

Found a post the shows how to install CakePHP in IIS7 Click Here

Use memcache in CakePHP

CakePHP No Comments »

Found a blog that shows how to use memcache in CakePHP easily.Click Here

How to get the current URL

CakePHP, CakePHP 1.2 No Comments »

$this->here

How to redirect to the root of your website

CakePHP, CakePHP 1.2 No Comments »

I was having a problem in going to the root of my website and I have solved it by using the code below
$this->redirect(“/”);

How to fix IE PNG problems

CakePHP, HTML, Javascript, Web No Comments »

Today I was having a problem displaying transparent PNG’s in IE and found this solution

It worked well.
Hope this helps :)


How to add a Website Icon in the Address Bar

HTML, Web No Comments »

Favorite Icons, or favicons for short, are 16px x 16px icons for your website. They are used by web browsers as your website’s icon when a visitor bookmarks your website or visits you website

Favicons are really simple to make, and because they add to your website’s image, there is really no reason not to have them. Look at the address bar now, you will see a blue W icon.

First you have to create a 16px x 16px icon.
Second rename your icon to the standard name which is favicon.ico
Third copy the icon file to your web root or any place you want
Fourth add this code inside the Head tag
<link rel=”shortcut icon” href=”/favicon.ico”>
The href path depends on where your icon is located.

That’s it!
By the way you can have different icons per page just put your favicons in different directory with the same standard name which is favicon.ico


Understanding CakePHP Model Associations

CakePHP, CakePHP 1.2 No Comments »

A clear and concise tutorial for understanding CakePHP Model Associations
Click Here


Sending any binary files to the user in CakePHP using Media Views

CakePHP, CakePHP 1.2 No Comments »

For more info Click here