Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Suresh Ariya:
Implement Flash Messages using Session in PHP (Part 1 & 2)
Feb 06, 2014 @ 17:08:55

In a two part series on his site Suresh Ariya shows you how to implement "flash messages" in your applications (in a framework-agnostic way) with the help of a custom script and the current user's session.

As part of the post series, today we are going to see how we can implement Flash Messages using PHP Session. Before proceeding into that, first i like to explain what is Flash Message and its usage. [...] Flash message is a message that will be shown/displayed only once. if you reload the browser or navigated to other pages and came back, you won't see the same message displayed again.

In part one he introduces the concepts behind flash messaging and gets into the initial steps of the implementation via a "FlashMessageInterface" to define the structure. In part two he gets into the actual implementation and shares a script that uses a custom prefix to define the messages and the expected getter/setter methods as well as "clear" functionality.

tagged: flash message series part1 part2 implementation interface

Link: http://sureshdotariya.blogspot.in/2013/12/implement-flash-messages-using-session.html

James Fuller's Blog:
Adding a Session Flash Message to your site in Lithium PHP
Aug 18, 2011 @ 13:32:05

James Fuller has a new post to his blog today showing how to use flash messaging in the Lithium PHP framework.

In my case, I needed to display to the user a "flash message" after redirecting them to another page. CakePHP has this as part of the framework by default but Lithium will ask you to do a bit more work. Luckily, Lithium framework lead developer Nate Abele has created a handy extension to the Lithium session helper will will give us exactly what we need.

For those not familiar with what a "flash message" is, he defines it as a message available to the next page load with relevant information about the previous page. He includes the instructions on how to get the extension for this working in Lithium - downloading, configuring and adding the output variable for the flash messaging to your layout. He also includes an example of how to set the message so it'll be saved into the current session.

tagged: session flash message lithium framework session tutorial

Link:

Richard McIntyre's Blog:
Weaving Lithium #li3 into a legacy PHP application incrementally
Dec 15, 2010 @ 15:18:17

Richard McIntyre has posted about his experiences in working the features the Lithium framework into one of his current applications, mostly because of its support for Doctrine and its heavily decoupled nature.

I have a legacy application which was originally written in straight PHP with a few classes that I have created for convenience, but this is old and I am wanting to get this into a modern web framework. [...] I wanted to update my site with better validations anyway so I will start with flash messages and then validations. For flash messages in lithium you will need the li3_flash_message plugin.

He works through the different parts of the framework setup he needed including a simple bootstrap file and configuring it to use the li_flash_message library. He shows how to use validation rules on submitted data to ensure things like email an link format validity as well as spit back a message for any that are incorrect.

tagged: lithium framework li3 refactor application flash message

Link:

Rob Allen's Blog:
Zend Framework's Flash Messenger action helper
Aug 24, 2010 @ 14:57:33

Rob Allen has a new post to his blog today about a handy helper that comes with the Zend Framework to help you store messages between requests.

I've talked about Zend Framework's action helpers before, but haven't covered any of the action helpers that are supplied with Zend Framework. FlashMessenger is a helper that allows you to store messages between requests. The most common use I have for it is for a "saved" message after doing an edit of an item that then redirects back to a list.

He includes an example of this helper in action in storing a sample message and pulling it back out on the other side. The message insert also includes a redirect() call and the output has a code snippet to check the messages property to see if there's any to show.

tagged: zendframework flash message helper action

Link:

DZone.com:
How to Use Flash for File Upload with PHP
Aug 12, 2010 @ 19:47:36

On DZone.com there's a recent tutorial about combining PHP and Flash to make a simple file upload tool for your site.

User contributed content; it is core to the web. [...] This article will cover how to upload content to PHP, first from an HTML form, and then from a Flash-based form. We will explore the challenges you will encounter, and propose solutions with an emphasis on the client.

They show the normal file upload method for using PHP to handle the incoming content (explaining each piece along the way) and then include the Flash code you'll need to make things work similarly. They include some checking on things like file extension, file size, file type filtering and a progress indicator. They also show you how to give it multiple file capability. You can download the code in a complete zip package.

tagged: flash file upload tutorial

Link:

Jozef Chuťka's Blog:
Image Caching With PHP
Jun 04, 2010 @ 16:33:44

Jozef Chutka was working on a Flash-based application and, in trying to optimize it, figured that he'd set up an image caching system to keep the app from having to grab the images each time. The result is shared in this post - a simple tool that relies on HTTP headers to notify the client if anything's changed.

I can not hold all of those [requests] within flash player cache because some of them may change, and I also want shortest possible respond times and client-server traffic reduction as well as server side computing reduction. That's where browser caching comes into the scene. I have experimented a bit with all possible http headers to understand each browser specifics and I came with a solution.

He includes a snippet of code that shows how it would check the current image and send the correct headers as to whether or not it needs to be updated from the cached version the application has. This also keeps you from having random parameters in your requests because the server always assures the content is fresh.

tagged: caching image flash http header tutorial

Link:

Sony AK Knowledge Center:
Create Realtime Chart Without Page Refresh using FusionCharts Free & Ajax
Mar 03, 2010 @ 19:36:55

On the Sony AK Knowledge Center there's a new tutorial showing how to use FusionCharts (Free) to create a real-time charts with no page refresh. FusionCharts is an open source Flash charting component for desktop and web apps.

We will create realtime chart data update that reflect to price fluctuation. There is a line type chart to visualize the price fluctuation. The data of price fluctuation will be fetched from database every 5 seconds using Ajax call and then display the latest 5 (five) data to the chart without any page refresh.

Using FusionCharts and Prototype, they show how to pull information out of a backend MySQL database into a basic graph (HTML and Javascript provided) with a periodic update that grabs the latest from the backend PHP script and pushes it to the graph. You can see an example of the graph here.

tagged: tutorial realtime chart flash fusioncharts ajax javascript

Link:

RIAZone:
Integrating PHP with Flash Collaboration Services
Dec 14, 2009 @ 19:47:28

On the RIA Zone (a part of the DZone network) there's a new tutorial from Ryan Stewart about combining PHP with the Flash Collaboration Services (real-time collaboration and social capabilities via the LCCS) in the second part of his series (part one).

Another great way to integrate LCCS and PHP is with the REST APIs and the library that ships with the LCCS SDK. With those APIs we can perform a number of management functions including creating and deleting rooms, managing roles, and creating templates. These APIs make it very easy to create a customized, dynamic collaboration experience with PHP. You can create rooms on the fly for your users and get information about what kind of content is in those rooms. In this example we're going to create a basic room manager with PHP that will let us create, delete, and view information about specific rooms.

Code is included to use the AFCS PHP library to connect to the Services API and pass in the username and password directly from the user. The request is made and a token is passed back to the calling script. The XML description of the full Flex application is included in the tutorial.

tagged: flash collaboration services api tutorial

Link:

NETTUTS.com:
15 Wonderfully Creative Uses for PHP
May 04, 2009 @ 12:56:42

NETTUTS.com has posted their list of the top fifteen "wonderfully creative" uses for PHP on your sites.

If you are familiar with the basics of PHP, then you're probably wondering how you can use it to make your website more appealing. The possibilities are endless, and you can write your own PHP scripts or implement widely available scripts from around the web. Let's get started with 15 creative uses for PHP for your website!

Some of the uses mentioned include:

  • E-Commerce
  • Graphical User Interface
  • Building an Online Community
  • Parsing XML Files
  • Image Processing and Generation
  • Create a PHP Photo Gallery

Others include templating, working with Flash and with one of the more popular PHP blogging tools - WordPress.

tagged: creative use ecommernce gui community xml image flash wordpress template

Link:

ProDevTips.com:
Zend Amf and class mapping with Flash CS3 / AS3
Mar 25, 2009 @ 18:09:19

On the ProDevTips.com site there's a new tutorial talking about mapping a class using the Zend_Amf component (of the Zend Framework) to map functionality with Flash.

Instead I’m mapping the variables explicitly in the Shockwave, I have no example of doing the reverse, ie sending an object from flash and populating. I’m however not going to use an ORM like Doctrine with the project I’m going to do here so that won’t really be a problem. The main thing is that we can easily populate AS objects.

They include both the Flash code - connecting the Flash application to the PHP gateway - and the PHP code to create a Zend_Amf object and handle the Flash request. In their example, they call a User class to locate a user record.

tagged: prodevtips flash zendframework zendamf tutorial

Link:


Trending Topics: