News Feed
Sections




News Archive
feed this:

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

Oliver John Tibi's Blog:
Mobile-ize Your CakePHP Application
December 20, 2011 @ 09:11:10

In a new post to his blog, Oliver John Tibi has the first part of a series looking at mobile-izing your CakePHP application, making it mobile friendly when a mobile browser is detected.

I'll be writing a short series of posts on how to create a mobile version of your CakePHP app. I've always been bragging to my peers how awesome CakePHP is, and so now I'm writing a short tutorial on how to create a mobile-friendly version of a CakePHP app. I promise to make this as easy as possible.

In this first part of the series he helps you do two things - set up some custom routes for the mobile version of the site ("/m") and add in browser detection using the RequestHandler's "isMobile()" method.

0 comments voice your opinion now!
mobile browser detect tutorial series cakephp framework


Derick Rethans' Blog:
Translating Twitter
January 05, 2011 @ 10:05:46

In a new post to his blog Derick Rethans shows how to implement something very handy for those wanting to read all of the posts in their twitter stream, regardless of the language. Using Google web services, he's put together a twitter translation for his twitter client Haunt.

As the author of Xdebug I am interested in finding out what people think of it, and whether they have problems or compliments. I've set-up a twitter account for Xdebug, @xdebug, and my twitter client Haunt also shows me all tweets with the search term xdebug. However, sometimes I get tweets in a language I can't read.

Since there's no language information associated with tweets, Derick used Google's Language Detect web service to get the language code for the text. Another quick call to the Translate service and a suable translation is returned. You can see how it looks in his screenshot. You can find the code for it here.

0 comments voice your opinion now!
translate twitter language google webservice detect


TheseDays.com:
An Easy Way to Detect Mobile Devices
August 11, 2010 @ 08:24:35

On the These Days blog there's a recent post talking about creating a mobile version of your site and how you can detect if the visitor is using a mobile browser or not using WURFL.

WURFL, The Wireless Universal Resource File (WURFL) is an open source project which collects information about all of the different mobile devices in use. It is constantly being updated, so as long as you keep your WURFL definitions up-to-date you don't have to worry about your detection scripts not recognising new devices. By querying a WURFL database with your visitor's User Agent string, you can not only determine whether the device they are using is a mobile device, but whether it has a touch screen, can make phone calls, is a tablet (iPad) and more.

They include a snippet of code that uses the Tera-WURFL service and a call to getCapabilitiesFromAgent to see what kind of client is making the requests and what it supports.

1 comment voice your opinion now!
detect wurfl wireless mobile device snippet


Danne Lundqvist's Blog:
Detecting UTF BOM - byte order mark
April 29, 2010 @ 11:47:03

In a new post to his blog Danne Lundqvist looks at a common pitfall that could trip you up if you're not careful with your UTF-8 data - not looking for the UTF byte order mark that tells the application if it needs to be handled as UTF content.

One such thing is the occurrence of the UTF byte order mark, or BOM. [...] For UTF-8, especially on Windows, it has become more and more common to use it to indicate that the file is indeed UTF. Most text editors handle this well and you won't ever see these bytes. As it should be.

He points out what could cause an issue - using strcmp or substr but it can be prevented by looking at and removing those first three bytes if needed. He includes a snippet of code that does just that.

0 comments voice your opinion now!
byteordermark utf utf8 utf16 detect


David Walsh's Blog:
iPad Detection Using JavaScript or PHP
April 13, 2010 @ 12:22:22

David Walsh has a new post to his blog today with some code snippets that can help you detect iPad users when they come to your site.

The hottest device out there right now seems to be the iPad. iPad this, iPad that, iPod your mom. I'm underwhelmed with the device but that doesn't mean I shouldn't try to account for such devices on the websites I create.

He includes three ways to get the job done by matching against the User Agent sent by the browser - Javascript, PHP and with an .htaccess file for an Apache server. As one commenter points out, though, you need to be sure if you already have a redirect on the word "mobile", the iPad's User Agent contains that too.

1 comment voice your opinion now!
ipad apple detect useragent


PHPFreaks.com:
Protecting php applications with PHPIDS
December 22, 2008 @ 08:49:42

On the PHPFreaks.com website there's a new article looking at one way to help protect your website from those evil doers out there looking to cause you and your data harm - PHP-IDS.

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application. The IDS neither strips, sanitizes nor filters any malicious input, it simply recognizes when an attacker tries to break your site and reacts in exactly the way you want it to. [...] In a nutshell PHPIDS is an advanced intrusion detection system written with performance on a large scale in mind. The basic installation and configuration is pretty straight forward.

They (briefly) step you through the installation and configuration of the tool and provide a sample script to get the ball rolling - a file that can be auto_prepended to all scripts run on your Apache server to filter and log incoming requests.

0 comments voice your opinion now!
tutorial phpids tool security protect filter log detect install configure


Zend Developer Zone:
Zend_Service_Mollom
December 09, 2008 @ 09:32:05

A new post on the Zend Developer Zone looks at a component recently introduced into the Zend Framework to help with comment spam (and no, its not Akismet) - an interface to Mollom.

If you run a blog that accepts comments, you're probably familiar with comment spam. You could manually verify all comments, but that gets cumbersome after some time. A better solution is using an automatic scanner to verify comments. Like Mollom. Mollom checks your comments and provides CAPTCHAs if it's not 100% sure (about 2% of all comments).

The component is up to version 1.1.0 now and you can learn more about it (and find some downloads) on this page.

0 comments voice your opinion now!
zendservicemollum captcha comment spam detect


Robert Eisele's Blog:
Face detection with PHP
July 24, 2008 @ 12:55:41

Robert Eisele has posted on an interesting topic recently - using a PHP interface to the OpenCV library (from Intel) to detect faces in images.

The headline does say facedetection - but what does this mean? Easy said, this article focus on how to find faces on images with PHP. Faces have a certain form and so it is possible to search for it. At the end of the search you will say how many human faces are on the image or better: Where are human faces on my image. This article is not intended to be mathematically.

The OpenCV library is a pattern-detection tool that can, based on the "experience" it has trained on with sample files, do its best to find similar structures in any given image. He's come up with a wrapper that handles most of the details for you. You can define the xml file type (frontalface, lowerbody, upperbody, etc) that you want it to try to match to.

He gives some examples of the output from each on one of the sample images included in the training group as well as a random photo grab from flickr that dynamically tries to apply one of the face filters.

0 comments voice your opinion now!
face detect opencv intel wrapper tutorial


Jonathan Snook's Blog:
Multiple Validation Sets in CakePHP 1.2
July 23, 2008 @ 07:51:27

Jonathan Snook has posted two methods for creating multiple validation sets in the latest version of your CakePHP application.

In CakePHP, you define how your data should be validated by setting parameters on the validate property of your model. In version 1.2, there is an on option that can be set on a specific rule that, when set, is either create or update. [...] Despite that, I developed a slightly different approach that allows for different validation sets to be specified and to be cleanly separated from each other.

He overrides the validates() method with his own in a custom model in one of two ways - having the script check for a validation set for the current controller or by specifying it directly with a validationSet property. Code for both methods is included.

0 comments voice your opinion now!
cakephp framework validation set detect controller property define tutorial


Derick Rethans' Blog:
Detecting Timezone By IP
May 07, 2008 @ 11:15:24

Derick Rethans has posted a method he's come up with to try to figure out the user's timezone based on the IP address they're using:

Through Planet PHP I found an article on Pre-populating forms with the timezone. I'd normally add a comment instead, but the comment would almost be larger then the original post, so I am instead writing up an entry myself. The post describes several ways to obtain the user's timezone and use that to pre-fill a form. None of them are working properly though.

In Derick's method combines a bit of Javascript with some PHP to correctly find the timezone.

0 comments voice your opinion now!
detect timezone ipaddress maxmind goeonames ip2location



Community Events





Don't see your event here?
Let us know!


tips introduction zendserver deployment release language opinion interview library package podcast framework laravel community list symfony api update install series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework