Kurinchi Blogger Scribbles …


Posts Tagged ‘PHP’

Jul 07
2009

CakePHP: Caching and issues related to it

Last updated: July 7th, 2009

There may be occasions that the programs that you develop in your development environment does not fetch the desired results when the programs are moved to the production environment.

The possible cause of this problem may be due to active caching in cakePHP which tends to bring in copies of text from older program revisions.
(more…)

Jul 05
2009

Configuring CakePHP in localhost

Last updated: July 9th, 2009

Quick and easy steps

Grab a copy of cakePHP from cakephp.org website

You can either create the new cakephp website in the root (http://localhost/) or by adding it as a subfolder (http://localhost/mycakesite/)

If you create it as a subfolder, then configure the appropriate path settings for linking images in the web pages.
(more…)

Jun 28
2009

PHP: Buffer Overflow

Last updated: June 29th, 2009

PHP Program Flow
A call that is made to execute a sequence of code in PHP program is sent to PHP core library written in C programming language which in turn would talk with the underlying operating system to get the results of its execution.

What is buffer?
A buffer is a temporary memory location to hold data for faster program execution time. The data may be stored as a heap or as a stack. Stack can be visualized as a FILO array of data and heap as a linked list of data.

Why we need to take care of buffer overflows?
Programmers who know about certain loop holes can exploit this feature in by pointing a record in the heap or stack to prewritten block of hackable code. These are called buffer overflow attacks.
(more…)

Jun 05
2009

CakePHP: Parsing RSS feed in Simple Steps

Last updated: June 8th, 2009

How to read RSS feeds (XML file) and display contents in CakePHP?

Parsing an XML feed can be done in simple steps as follows in CakePHP …

CakePHP Controller: /app/controllers/rss_controller.php

<?php
/**
*	CakePHP Controller to parse XML file
*/
class RssController extends AppController{
	var $name = "Rss";
	// As the RSS will not currently use a database
	var $uses = array();
	var $feed_url = "http://kurinchilamp.kurinchilion.com/feed";
	var $rss_item = array();

	function index(){
		App::import('Xml');
		$parsed_xml =& new XML($this->feed_url);
		// xml to array conversion
		$this->rss_item = $parsed_xml->toArray();
		$this->set('data', $this->rss_item['Rss']['Channel']['Item']);
	}
}
?>

CakePHP View: /app/views/rss/index.ctp



Jun 01
2009

PHP: CakePHP and XML

Last updated: June 1st, 2009

How to get XML content in cakePHP controller?

App::import('Xml');
$url = Server.Mappath("file/xml_file.xml");
$parsed_xml =& new XML($url);
Jan 24
2009

PHP: Personal Home Page

Last updated: January 24th, 2009

Personal Home Page – PHP Hypertext Processor

1997 – PHP/FI 2 solely handled by Rasmus

1998 – Zeev and Andi teamed up with Rasmus to give a new face to PHP by rewriting the core engine and a facility to interface with different technologies using API giving rise to the next version PHP 3. PHP 3 continuously parsed the scripts when they were getting executed. (more…)

Dec 24
2008

phpMyAdmin – visual interface for MySQL on Windows/Linux

Last updated: April 14th, 2009

phpMyAdmin is a web based interface to MySQL which is written using PHP for Administration of databases. Visual interface provided is intuitive and it saves time for the developers. (ver 3.1.1 is the recommended version as of this writing which runs on PHP 5/MySQL 5)

Step 1: First we need to check MySQL is installed by issuing the following command
[root@user Desktop]# which mysql

If you get …
/usr/bin/mysql
then, it is an indication that MySQL is installed in your machine. (more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict