background preloader

PHP

Facebook Twitter

PHP: How to Get the Current Page URL.

Wordpress

FB.getLoginStatus - Développeurs Facebook. Subscribing to the authentication events fired by the JS SDK means your app will be notified if the user's session state changes. This is important because the session state may change due to user interactions beyond your app's control. The only way your app can be notified of these changes is through subscribing to these event. Examples of interactions which can change the state of the user include FB.login(), FB.logout() and the Login button. Widgets such as the Comments plugin may also trigger authentication. auth.login This event is fired when your app first notices the user (in other words, gets a session when it didn't already have a valid one). auth.logout This event is fired when your app notices that there is no longer a valid user (in other words, it had a session but can no longer validate the current user). auth.authResponseChange This event is fired for any auth related change as they all affect the session: login, logout, session refresh.

Auth.statusChange status authResponse. Foreach. You can even iterate through "dynamic" arrays that do not physically exist, but are objects that implement Iterator interface. They don't need to be stored in memory when foreach starts. Consider the array that contains some values (I called it $allValues in the example below) and we want to have only some of them (eg. the ones that are dividable by 2).

I create an object that would serve as dynamic array, that means it would "dynamically update" its values together with $allValues. The main advantage is that I store only one array, and it's the only array I serialize. An object of MyIter class will not contain any values itself:<? Phpclass MyIter implements Iterator { private $position = 0; private function getTable(){ global $allValues; $result=array(); foreach($allValues as $obj){ if($obj % 2 == 0) $result[]=$obj; } return $result; } function rewind() { $this->position = 0; } function current() { $table=$this->getTable(); return $table[$this->position]; } $iterator=new MyIter();

Php script to create RSS-feed. SocialEngine PHP Social Network Script - Create your own social media community! 7 Secure, Lightweight, and Easy to Use PHP Frameworks. Choosing a good PHP frameworks can help you develop complex Rich Internet Applications quickly, with a best practices oriented approach, and saving a lot of time reusing code snippets that are already available.

There are a lot of interesting PHP frameworks you can choose for your next web project. Which framework you choose is really a personal decision. There is no one “best” framework on the market at the moment. Different frameworks are better for different types of projects, and for different developer. Today we will focus on 7 secure, lightweight and easy to use PHP Frameworks. Why Use a PHP Framework? There are plenty of reasons to use a PHP Framework to build your websites. 1. Below we’ve covered some of the best frameworks available today. 1.

CodeIgniter is a powerful, high-performance, open-source PHP framework that helps you author PHP applications rapidly. CodeIgniter has an exciting online manual, a couple of helpful video tutorials and an active user forum. 2. 3. 4. 5. 6. 7. PHP/MySQL.

PHP security

PHPMailer tutorial. This is meant to be an improved version of the article written by PHPFreaks founder, Eric Rosebrock on the PHPFreaks site HERE, simply because I noticed the URL for that tutorial often was down, so I rewrote it (close to verbatim) for my own personal use. PHPMailer is by far the BEST way to add email functionality to your web site. This is just an article to point you in the right direction to mastering this incredible php package. Tutorials, Guides, Documentation, and HowTos ^ Other PHPMailer links ^ Introduction ^ Sending E-Mail through PHP can be simple, or it can be very complex depending on what you want to do. A standard plain-text E-Mail is what most developers resort to because building the MIME headers for HTML mail can be a difficult process. Requirements ^ The requirements of this tutorial are very limited. Don't sweat it, this is going to be an easy tutorial for you to follow!

About PHPMailer ^ PHPMailer Features ^ PHPMailer Contributors ^ The following contributors to PHPMailer are: Write your own PHP MVC Framework (Part 1) | anant garg. What is MVC? From Wikipedia– Model–View–Controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other.

In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model. In simpler words- 1. Why should I write my own framework? This tutorial is by no means a comprehensive/definitive solution to your framework needs. So why should you write your own framework? More importantly, you have complete control over your framework. Lets dive right in The Directory Structure Coding Conventions view.php add.php. PHP crawler script. DevNetwork Forums • Index page.