High Performance Industrisl Soluations

Advanced PHP, MySQL and web security related topics brought to you by PHP Guruji.

accept-charset (HTML attribute)

The accept-charset attribute specifies the character encodings that the server can handle or process for input data.

Example

In this form, we tell the server to accept Windows-only character sets (which isn’t a brilliant idea, to be honest):



<form action="form-to-email.php" method="post"
accept-charset="windows-1252">
<div>
<label for="txtname">Name:</label>
<input type="text" name="txtname" id="txtname"/>
</div>

</form>




Value

This attribute can accept a space- and/or comma-delimited list of charset values. The default value for this attribute is the reserved string “UNKNOWN.” Browsers may interpret this value as the character encoding specified in the head of the document.


Internet Explorer’s support for accept-charset is buggy. If the attribute’s specified as "ISO-8859-1", IE will happily send data encoded as "Windows-1252".

JavaScript/Ajax Bootcamp

This course uses the Dojo JavaScript Toolkit, but the skills learned can be used with any of the standard JavaScript libraries.

Upon completion of JavaScript/Ajax Bootcamp, the student will:

Be able to demonstrate extensive knowledge of DHTML (JavaScript, HTML, and CSS)
Understand the Dojo Toolkit with emphasis on building slick, interactive, advanced web applications
Understand how to use Dojo's powerful JavaScript standard library as protection from the bare metal of the browser
Be able to create custom widgets that work on all of the mainstream browsers
Be able to put Dojo's extensive collection of accessible and internationalized turn-key widgets to work
Understand how to use Dojo's build system to minify and consolidate JavaScript files and templates so pages load lightning-fast
Be able to write good unit tests for web apps -- even interactive ones -- and be able to effectively test in all mainstream browsers
Understand how to animate content and perform 2-dimensional drawing in web appliations -- all without Flash!
Have a library of tips and techniques for production settings"
Make sure to check out the Syllabus as well on the page which looks really cool.

ZFSnippets.com - Zend Framework Code Snippets

Dave Marshall has pointed out a site he's developed that Zend Framework developers out there might find handy - ZF Snippets.

I thought [the djangosnippets.org site] was pretty cool, and realised we didn't have a one stop shop for Zend Framework code snippets. Symfony and CakePHP also have dedicated sites for this. [...] I thought it'd be another good learning opportunity to build my own with the Zend Framework, for the Zend Framework.

The site makes use of several of the Zend Framework components and has already been populated with a few examples to get things started. He has plans for its future including full searching, version history for each snippet, user collaboration and a scoring/ranking system for the quality of the snippet.

Using PayPal's Instant Payment Notification with PHP

On NETTUTS.com a recent tutorial has been posted about the integration of your PHP application with PayPal's Instant Payment Notification system.

Today we are going to combine Paypal with PHP to allow for the easy processing of payments on your website.

You'll need a Premier PayPal Account to get it all working as well as already have a server with a working PHP installation (there's no setup and install for that in this tutorial). There's ten different steps in the process and screenshots and code are provided the whole way:

* Creating a PayPal Account
* Enable IPN
* Building a Simple HTML Page
* Building a PayPal Button
* Writing ipn.php
* Creating the Database
* Account Creation
* Emailing the Login Credentials
* Invalid Payment Email
* User Login

Check your design with text size increased to 200 percent

A basic accessibility guideline is that users should be able to increase text size when viewing your site without content disappearing or otherwise becoming unreadable. That’s pretty easy to understand.

What has not been clear is where to draw the line – how much do we need to increase text size when testing our designs? After all there will (almost) always be a point when the text is so large that the layout breaks in a bad way, making parts of it unreadable.

Fortunately WCAG 2.0 provides a more measurable guideline, 1.4.4 Resize text:

Except for captions and images of text, text can be resized without assistive technology up to 200 percent without loss of content or functionality. (Level AA)

With more and more browsers getting support for full page zoom functionality, some argue that you no longer need to consider what happens when only text size is increased. WCAG 2.0 does state that “The scaling of content is primarily a user agent responsibility”. However, I don’t think you can rely on zoom support being available and used by enough people to forget about text only resizing just yet.

From Understanding Success Criterion 1.4.4:

The author cannot rely on the user agent to satisfy this Success Criterion for HTML content if users do not have access to a user agent with zoom support. For example, if they work in a environment that requires them to use IE 6 or Firefox.

My interpretation of that is that until the vast majority of people use browsers that have zoom support (and browsers’ zoom support has matured), you should make sure that text can be scaled to 200 %.

I don’t think that is too much of a burden – 200 % is less than you may think. This flexibility benefits people who often increase text size but do not want to scale the entire page (I’m one). It also benefits people who have changed the default text size setting in their browser and many who have specified a minimum font size. As a bonus, making your design flexible enough to handle text enlarged to 200 % means that it will also be better at handling varying amounts of content.

A good tool to use when checking your site with larger text is the Firefox add-on NoSquint, which can be configured to show the current text zoom level in the status bar.

Of course you will need to compromise sometimes – some designs are harder than others to make flexible enough for 200 %. The most important thing is that you check what happens when you increase text size and do what you can to allow for 200 %.

Way too many sites out there quickly become more or less unusable when text size is increased to much less than that. Make sure the sites you build don’t.