Skip to main content

Posts

Setup CakePHP Using Xampp On Windows

Step 1: Download XAMPP  and  CakePHP .   Step 2: Install Xampp Once you have installed Xampp (version 1.7.3) on your Windows with the default option, all your files will be located in the C:\xampp folder. Step 3: Mod Rewrite Module Once Xampp is installed as the local server, you can then proceed to enable mod_rewrite. To do so, you will have to open the httpd.conf file that is located in C:\xampp\apache\conf and uncomment by removing # from the following line: # LoadModule rewrite_module modules/mod_rewrite.so Step 4: Place CakePHP Files in a New Folder Extract the CakePHP (version 1.3.8) zip file and copy all its contents to your local web server, which in this instance is C:\xampp\htdocs\cakephp . I have decided to name the CakePHP folder as cakephp, and in it, you will find many files and folders for the framework, including app, cake, docs, vendors, .htaccess, and index.php. Step 5: Set Up Virtual Host Open the httpd-vhosts.conf file from th...

Dynamic Sitemap Generation plugin in Cakephp

Here for the SEO implementation we need to generate the sitemap.xml in our application which is accessed by the webmaster tool. So here i am outlined the steps to generate the Xml file . 1. Lets think we have controller by name sitemap,Inside that create an action by name sitemap and paste the following code    public function sitemap(){     $this->layout='ajax';     $this->RequestHandler->respondAs('xml');     $listData = $this->Sitemap->find('all',/*Conditions if you have any*/);     $this->set(compact('listData')); } I through variable $listData to render all data( Keywords,Title,Url,etc ...) that will be shown in sitemap.xml.  This   depends   on the   dynamic link  what   we want to   show  in sitemap.xml.For request handler to work include the RequestHandler component public $components = array('RequestHandler'); Step 2. Create View based on...

PHP & Mysql interview question

What’s PHP The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications Who is the father of PHP and explain the changes in PHP versions?  Rasmus Lerdorf in 1994   How many ways you can retrieve the data in the result set of mysql using PHP? We can do it by 4 Ways          1. mysql_fetch_row ,                The mysql_fetch_row() function fetches one row from a result-set and returns it as an                enumerated array.         2. mysql_fetch_array ,                The mysql_fetch_array() function fetches a result row as an associ...

PHP and MySQL referal guide

Use PHP Statements to Create Programs PHP programs are a series of PHP statements, executed one at a time. Here’s a list of the PHP statements (with syntax) that you use when writing PHP programs: array ( "key" =& gt ; "value" , … ); die ( "message" ); do { block } while ( condition ); echo item ; extract ( $array ); for ( startingval ; endingval ; incremnt ) { block } foreach ( $array as $key =& gt ; $value ) { block } function funcname ( value , value ,…) { block } header ( "Location: URL" ); if ( condition ) { block } elseif ( condition ) { block } else { block } number_format ( number , decimals ); session_start (); session_destroy (); switch var { case value statements break ; … } unset (); while ( condition ) { block } Communicate with a Database through PHP MySQL Functions PHP communicates with MySQL databases by using a set of functions developed specifically ...

Migrating from CakePHP 1.3 to CakePHP 2.x

Installing CakePHP 2.0 This is pretty straight forward. Install Cake per the instructions. There isn't much difference between installing CakePHP 2.0 and previous versions. Unzip the downloaded file in your desired location. Configure CakePHP core.php You should start with default core.php file. Update the configuration values to match those in the app you are migrating. Make sure you copy the Security.salt and Security.cipher_seed from your old core.php or you won't be able to login in addition to other possible security issues. Copy any custom configuration values you have added to your old core.php. Take notice of how errors, sessions, and caching has changed. database.php The database configuration has only a minor change in how you designate the database engine. Previously, you used this: 'driver' => 'mysqli', now, you use this: 'datasource' => 'Database/Mysql', routes.php The Route file has been changes sligh...

Why the Latest PHP 5.5 is Impressive on Ecommerce Stores?

               LAMP (Linux/Apache/MySQL/PHP) platform is a successful alternative to commercial software for building and operating dynamic and high performance web systems. PHP has become one of the major player on the web development market in the last few years. For all Linux hosting packages, PHP 5.5 has recently become the standard version. The upgraded PHP version 5.5 comes with lots of changes and value additions.Most of the changes are beneficiary for the e-commerce stores running on php. Here’s a Brief description of what php version 5.5 has to offer your e-commerce store…. (i) Addition of keywords : In php version 5.5, the provided refinery keyword facility will allow a developer to define block code, cache block for better keyword search. It improves the result of the search based on keywords. Keyword search is very much helpful in the e-commerce online stores. (ii) Availabili...