Posts Tagged ‘PHP’

Ultimate Collection of PHP Libraries

Having a collection of php libraries in one places will help you get your job done faster. It help me, so I share my list. I’ll keep update the list with more libraries.

Continue reading »

Submitting Form and Progressive Enhancement

Most users nowadays familiar with AJAX, well they don’t really know the term.
What users familiar is the experience, such as of submitting form without reloading the page.

So when you build new website or your web application, don’t forget to include this experience. But you also have to remember, there are some people who turn off their javascript or maybe the javascript failed to load. That is why, you should consider to use progressive enhancement.

In progressive enhancement, you can make your web application work in condition where no javascript available or failed, and enhance them if javascript available.

Lets just go with example, we’re building a form that will submit and reload to new page, but when javascript is available the form will be submitted via AJAX without reloading the page.

Continue reading »

CodeIgniter Tutorial Compilation

I write small CodeIgniter tutorial compilation, it’s not finished yet. Really like to have more feedbacks. Tweet me at http://twitter.com/komunitasweb
Thank you for your feedback.

Showing the weather with PHP and Google Weather API

weather

If you need to show weather in your website, you can use weather widget such as weatherbug. It’s nice and simple, but maybe you need something more integrated with your website. So, take a look at Google Weather API.

http://www.google.com/ig/api?weather=[city name]

Example :

http://www.google.com/ig/api?weather=jakarta

It will give you xml data, and you can parse it easy in PHP. Take a look at sample code.

Continue reading »

4 Simple PHP RSS Parser

Sometimes you need to parse RSS from other website and integrate to your project. Well you can create your own library to parse that RSS, but before wasting your development time, please take a look these great libraries for parsing RSS.

SimplePie

simplepie

SimplePie is a very fast and easy-to-use PHP class to parse RSS.

Features :

  • Single file, no install.
  • Cache mechanism.
  • Has plugin for such as Wordpress, Joomla, Drupal and others.

Continue reading »

PHP Tips and Tricks

php

After years use PHP, there is always a time where I find myself look back to PHP documentation.

PHP has many functions, if you’re new to PHP, you won’t note some of useful function to remember.

There are also some of technique that you couldn’t learn by just looking PHP documentation.

For a beginner, who just learning basic PHP programming, I have collect some of tips and trick to help you upgrade your skill.

Continue reading »

CodeIgniter Tutorial – ORM with DataMapper

datamappertutorial

If you familiar with CodeIgniter, then you have realized by now that you can’t have relationship manager.

Yes, CodeIgniter doesn’t have built-in ORM. But there are several projects such as IgnitedRecord and DataMapper that will help you manage relationship between your models.

In this tutorial, I will introduce you to DataMapper.

From DataMapper Website

DataMapper is an Object Relational Mapper written in PHP for CodeIgniter. It is designed to map your Database tables into easy to work with objects, fully aware of the relationships between each other.

Features

  • Everything is an object!
  • Easy to setup, easy to use.
  • Custom Validation on object properties.
  • Lazy Loading (related objects are only loaded upon access).
  • Relations and their integrity are automatically managed for you.
  • One to One, One to Many, and Many to Many relations fully supported.\
  • Select data in the style of Active Record (with or without Method Chaining).

Ok let’s start our journey.

Continue reading »

CakePHP ACL Tutorial – What and How

CakePHP ACL

In this tutorials, I’ll show you everything you need to know to get started with CakePHP ACL. First you need to know what is ACL, and how ACL is implemented in CakePHP. Are you ready?

What

ACL or Access Control List is security concept about permission. It’s contain a list of permission to access some of resources. It specify who and what is allowed to access something.

In CakePHP ACL is used to specify users access to a controller, or specific action of a controller. Before we get to the how to section, there are a few terms we have to understand first.

  • Access Request Object (ARO) is defined who want to access or request object. In simple term, it will be a user or group. This list of user or group is stored in table called ‘aros’.
  • Access Control Object (ACO) is defined object that is being protected from a user or a group. In other word ACO related with which controller or action of controller you want to protect. ACO is stored in table called ‘acos’.

‘acos’ and ‘aros’ table is created automatically when you initialize the DB Acl tables (we’ll get into this later in how to part). Along with those table, there is table called ‘aros_acos’ which specify relationship between ARO and ACO. In english it will be mean which user has permission to a controller or action of controller.
Continue reading »

CodeIgniter Tutorials to Help You Get Started

Do you like CodeIgniter? Here a CodeIgniter round up collection to help you get started with this framework.

Introduction and Basic CodeIgniter Tutorial

  1. Introduction to Code Igniter: Part 1 – CodeIgniter introduction, get started with Model, View, and Controller in CodeIgniter
  2. Introduction to Code Igniter: Part 2 – Form and validation.
  3. Introduction to Code Igniter: Part 3 – Working with database.
  4. Everything You Need to Get Started With CodeIgniter – Introduction to CodeIgniter, installation and sample
    application.
  5. Building a Complete CodeIgniter Application: Part 1 - Installation and configuration.
  6. Building a Complete CodeIgniter Application: Part 2 – Feed parsing using SimplePie, unit testing and database.
  7. Building a Complete CodeIgniter Application: Part 3 -Handle security issue.

Basic

  1. Templating With CodeIgniter – Basic templating with CodeIgniter.
  2. Code Igniter Template Tutorial -Another template tutorial for CodeIgniter.
  3. Forms in CodeIgniter Views – Form tutorial in CodeIgniter.
  4. Pagination with Code Igniter – Build pagination system in CodeIgniter
  5. CodeIgniter: Interacting With a Database – Get close with database.

Need more advanced tutorials? Fine, we have here.
Continue reading »

101 PHP Tutorials for PHP Programmer Wannabe

When I type this, google for ‘php tutorial’ result 8,950,000 pages. Yes, there are tons of great tutorial about PHP. But when you’re a beginner, it will make you confuse what tutorials you should read. Either it’s too complicated or just waste your time.

So, here the shortcut. Take it and be a better PHP programmer by tomorrow. Hmm, maybe not that fast. But here they are.

WebMonkey

  1. PHP Tutorial for Beginners

PHP 101: PHP For the Absolute Beginner

  1. PHP 101 (part 1) Down the Rabbit Hole – An introduction to PHP’s variables and operators.
  2. PHP 101 (part 2) Calling All Operators – The rest of the PHP operators (there are many), and simple form processing.
  3. PHP 101 (part 3) Looping the Loop – Basic control structures explained.
  4. PHP 101 (part 4) The Food Factor – Arrays, PHP array functions, and what it all means.
  5. PHP 101 (part 5) Rank and File – Everything you’re ever likely to need to know about dealing with external files from a PHP script.
  6. PHP 101 (part 6) Functionally Yours – All about functions, arguments, passing by reference, globals and scope.
  7. PHP 101 (part 7) The Bear Necessities – A gentle introduction to object oriented programming in PHP 4 and PHP 5.
  8. PHP 101 (part 8) Databases and Other Animals – All about connecting to a MySQL database from PHP, using the mysql or mysqli extensions.
  9. PHP 101 (part 9) SQLite My Fire! – Introducing another database: SQLite.
  10. PHP 101 (part 10) A Session In The Cookie Jar – Sessions and cookies – how to keep track of visitors to your site.
  11. PHP 101 (part 11) Sinfully Simple – An introduction to PHP’s easiest method for dealing with XML.
  12. PHP 101 (part 12) Bugging Out – Basic error handling.
  13. PHP 101 (part 13) The Trashman Cometh – A primer in basic security.
  14. PHP 101 (part 14) Going to the Polls – Putting the pieces together – a first Web application.
  15. PHP 101 (part 15) No News is Good News – Creating a simple RSS news aggregator.

Continue reading »