background preloader

Php

Facebook Twitter

PHP Tutorials

43 Ways to Optimize your PHP Code. 43 Must Read PHP Articles and Resources. Getting Snow Leopard built-in MAMP to work smoothly. Considering you are here, I can assume you are a desperate folk looking for a possible solution to make built-in MAMP work perfectly using the default packages that comes with clean Snow Leopard installation.

Trust me, I was feeling like you are now a few hours before I start this post. Here you’ll see how to enable Apache2, turn PHP 5.3 available on server and also install missing PECL extensions of PHP, such as Imagick ( ImageMagick ), Xdebug , APC and Memcache . Before we start I would assume you have Xcode and Homebrew installed. Installing PEAR on built-in PHP of Snow Leopard. If you followed my last blog post , now you have your PHP environment with missing extensions compiled and loaded. But we still lack of PEAR support. This post has the intention to explain how to install PEAR on your default Snow Leopard PHP binary. First open your Terminal and type these commands:

PHPBuilder.com, the best resource for PHP tutorials, templates, PHP manuals, content management systems, scripts, classes and more. Building Web Apps with the Limonade PHP Framework. So-called microframeworks such as Sinatra and Camping were created to provide developers with a lightweight alternative to Rails.

Building Web Apps with the Limonade PHP Framework

If your requirements are relatively straightforward, these lightweight solutions can dramatically reduce the learning curve and time required to complete the project. The PHP Limonade framework was created with this goal in mind, providing PHP developers with a low barrier-of-entry to the world of framework driven development without incurring lengthy training overhead.

Implementing User Authentication and Session Management with PHP. Outside of installation and configuration issues, reader questions pertaining to user authentication and session management almost certainly rank among the most common I receive on an ongoing basis.

Implementing User Authentication and Session Management with PHP

The logic itself is pretty straightforward; however, even a simple implementation involves a number of small but important details which aren't always so easy to figure out the first time around. This tutorial serves to dispel much of the confusion by guiding you through the implementation of a simple user authentication feature which will subsequently keep the user logged in via a session.

The Login Form Let's start with the easiest part of the feature, creating the login form. There's not much to describe here, as this form consists of just username and password fields, presented here: When rendered to the browser the form looks like that found in Figure 1. Figure 1. The MySQL Accounts Table Next, we'll create the MySQL table used to manage the user accounts. Authenticating the User.

Create a Dynamic Username Validator with PHP, MySQL and jQuery. There are few Web-related tasks more annoying than registering for a new website account.

Create a Dynamic Username Validator with PHP, MySQL and jQuery

Providing yet another online entity with various bits of personally identifiable information (did you know that in many cases you can be personally identified simply by providing your age, gender and zip code?) And frustrations surrounding a lengthy and often clumsy registration process are just two of the several aggravations which can arise when creating a new account. In recognition of the widespread reluctance to manage multiple accounts, several decentralized authentication solutions have gained traction, including notably OpenID and Facebook, however such approaches also have problems. So in spite of the availability of these third-party authentication solutions many website developers still choose to go it alone and manage user accounts locally.

One of the easiest ways to streamline the registration process is by providing the user with real-time feedback regarding username availability. Tracking User Activity in PHP with Cookies and Sessions. When you have more than one page in your PHP-based website and want to keep track of or personalize user activities, or when your application grows to more than just an information board, then it is time to maintain state in the site.

Tracking User Activity in PHP with Cookies and Sessions

The main purpose of maintaining state in PHP applications is to keep track of users and their activities. It can also be used to limit a user's ability to access certain components of a website. Without maintaining state, an e-commerce site would not be able to support shopping on the Internet, because the shopping cart needs to "remember" the products you selected to buy and it needs to maintain state for that. So, why can't you maintain state with HTTP?

The main reason is because HTTP is a stateless protocol, meaning that it has no built-in way of maintaining state between transactions. In this article we will look at what maintaining state in PHP applications entails. What are "cookies"? Setcookie('Username','MyName') Then you would retrieve it like this: PHP Multithreading with cURL.

Some applications need to perform several tasks that may take a while to finish.

PHP Multithreading with cURL

When there are many tasks to execute, it may take a long time to finish all of them if they are executed sequentially, i.e., one after another. A possible solution for this problem is to execute several tasks at the same time using separate processes or threads. PHP has the pcntl extension that can be used to run multiple processes in parallel. However, this extension is only available in Linux or UNIX-like operating systems. Getting Started with Jenkins for PHP Developers. The maturing Web development industry is inextricably intertwined with a constant companion: complexity.

Getting Started with Jenkins for PHP Developers

Gone are the days of assembling a few simple database-backed PHP-driven pages and calling it a website; these days clients expect rich JavaScript-based user interfaces, cloud-backed data stores, and tight integration with third-party APIs. To accommodate such challenges, developers have put a great deal of time and effort into devising tools and techniques which help to identify, track and resolve bugs. One such technique is continuous integration, which facilitates the merging of code changes made by various members of a development team by automating tedious processes such as testing, documentation generation, and deployment.

One popular continuous integration tool is Jenkins. (Jenkins is a recent fork of another continuous integration project named Hudson.) Installing Jenkins Jenkins is supported on a wide variety of platforms, including Windows, Linux, and OS X. Kom i gang med PHP. PHP ikke djevelens verk likevel. PHP-brukergruppen i Norge. PHP: Hypertext Preprocessor. PHP. PHP. Server-side scripting language PHP: Hypertext Preprocessor (or simply PHP) is a server-side scripting language designed for Web development.

PHP

It was originally created by Rasmus Lerdorf in 1994;[4] the PHP reference implementation is now produced by The PHP Group.[5] PHP originally stood for Personal Home Page,[4] but it now stands for the recursive initialism PHP: Hypertext Preprocessor.[6] The standard PHP interpreter, powered by the Zend Engine, is free software released under the PHP License.

PHP has been widely ported and can be deployed on most web servers on almost every operating system and platform, free of charge.[8] PHP Manual.