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

CodeForest.net:
Obfuscate your e-mail address with PHP, JavaScript and CSS
Oct 26, 2011 @ 12:39:01

A new post on CodeForest.net today gives you a technique for obfuscating email addresses with a combination of PHP, CSS and Javascript. It uses ROT13 for the obfuscation and some tricky CSS to keep it usable for the human visitors.

According to Wikipedia, more than 97% of all e-mails sent over the net are unwanted. That’s around 200 billion spam messages per day. To keep this insane amount of spam out of your inbox, you should keep your e-mail safe when you display it on web. One of the ways to keep it safe is to obfuscate it. In this tutorial I’ll show you how to create a script that will do just that.

The script converts the email address into a ROT13 obfuscated versions and reverse it. The spam bots harvesting addresses won't see it as a valid format but the user, thanks to some CSS rules, will see it and be able to copy it easily. Each part of the script is explained in the post and you can see a demo of it in action here.

tagged: rot13 email address obfuscate javascript css

Link:

PHPClasses.org Blog:
Locating addresses on Google Maps embedded in PHP generated Web forms
Nov 04, 2009 @ 12:45:51

On the PHPClasses.org blog there's a new tutorial showing how to use the goe-location support the Google Maps API offers to search for and find an address.

Sometimes it is necessary to get the coordinates of a location on the map. The map location plug-in lets the user point to any location by clicking on the map. [...] However, when the user does not know exactly where is the location he is looking for, it may be painful to find it just by zooming and looking around the map. The latest release of this plug-in makes possible for the users to type the address or name of the city you are looking for and search for the location without further effort.

He uses the form creation package to set up a simple address form (address and country) and a call to its connect() method to link Javascript to the form. When submitted, the new features of the class get to work and ask the Google API for the location and a map is generated with a marker on the spot requested.

tagged: form googleapi googlemaps address search class

Link:

DevShed:
Validating IP Addresses with Filters in PHP 5
Aug 26, 2009 @ 15:52:05

DevShed has posted the seventh part of their "validator" series today. This time they look at validating IP addresses with the filter_var function.

You can surely appreciate this functionality when developing modules, classes, plug-ins, etc. that must perform some kind of strong validation on incoming data. The filter extension comes armed with another handy filter, though, that permits you to check some common things, such as the IP addresses of client machines.

The give an example of using the FILTER_VALIDATE_IP constant to check the IP address format and include the optional FILTER_FLAG_IPV4 check for the IPv4 format.

tagged: validate filter ip address tutorial

Link:

Paul Gregg's Blog:
PHP algorithms: Determining if an IP is within a specific range.
Apr 28, 2009 @ 09:25:39

Paul Gregg has shared a method he's come up with to determine if a given IP is within a selected range.

Unfortunately although people usually understand that an IP address is simply an unsigned 32 bit integer, and is easily determined, usually with $_SERVER['REMOTE_ADDR'], where the real challenge is - is in specifying the range within which they wish to check that IP address. IP ranges are usually specified in three common ways (in increasing complexity): wildcard, start-end range, classless inter-domain routing.

He looks at each method and includes descriptions and code examples as well as a link to the source code and a live demo of it in action.

tagged: algorithms ip address specific range three method wildcard cidr startend

Link:

Community News:
XPath Explained (by Tobias Schlitt and Jacob Westhoff)
Feb 12, 2009 @ 10:28:04

Tobias Schlitt and Jacob Westhoff have written up and article (and posted it over on Tobias' blog) that wants to help you understand XPath better - whether you're a novice or have been using it for a while.

This paper will give an overview on XPath an addressing language for XML documents. XPath is a W3C recommendation currently in version 1.0. XPath was created in relation to the XSL recommendation and is intended to be used with XSLT and XPointer. Beside that, XPath can be used in a variety of programming languages, commonly in combination with a DOM API.

The article starts with an introduction to the concept of XPath, moves on to addressing, talks about XPath axes, mentions functions/operators/conditions and looks at styling XML with XPath and XSLT.

tagged: xpath xslt address axes function operator condition

Link:

NETTUTS.com:
Mimicking Apple's Address Book for the Web
Dec 02, 2008 @ 11:16:19

The NETTUTS blog has this new tutorial posted (including a screencast) showing how to make a web application similar to the Address Book on Apple's OS X operating system.

As we all know, WordPress is so extensive that you can use it for nearly anything. There are even articles on sites with crazy titles such as 101 alternative uses for WordPress. So I thought, hey, why not? I bet a lot of people want to create their own Web Apps, and essentially WordPress can do that for you. In this video tutorial, we're going to make an online Address Book.

Building on a WordPress base and including jQuery and a Live Search Plugin, they create the multi-pane look and feel, styled largely with CSS. The end result shows your address groups, the members of that group and the selected member's information in the far right pane.

As always, the complete source can be downloaded.

tagged: address book apple osx tutorial wordpress livesearch plugin jquery css

Link:

Knut Urdalen's Blog:
Washing emails
Nov 27, 2008 @ 14:42:56

Knut Urdalen has posted a new blog item about something he calls "washing emails":

In this tutorial I’ll show you how to create a simple PHP script to cleanup a list of email addresses. As a web developer you have probably been asked to wash a list of emails from a manager or marketer some times. Here’s the ultimate solution.

His script does a few things - removes duplicates, validates that the email address exists, uses pipes for communication and is as flexible as possible to work on most PHP distributions. You can download the simple script here.

tagged: washing email script duplicate valid address pipe flexible

Link:

DeveloperTutorials.com:
Writing an Email Autoresponder Script with PHP
Jan 04, 2008 @ 15:58:00

The DeveloperTutorials website has a new article that steps you through the creation of an autoresponder script for an email account (in qmail).

It's very convenient for users to be able to communicate with web applications (or businesses) via email, but it's not always easy for the employees of the company to respond. Some of the email requests could be complex, and others could be simple but occur very frequently. So it's a real advantage when we can write scripts to respond to user emails for us.

The tutorial sets up a basic structure for you to work from including places for the addresses and extra headers for the response. You can also download the code to have it to follow along with (or play around with yourself).

tagged: email autoresponder script qmail address header email autoresponder script qmail address header

Link:

DeveloperTutorials.com:
Writing an Email Autoresponder Script with PHP
Jan 04, 2008 @ 15:58:00

The DeveloperTutorials website has a new article that steps you through the creation of an autoresponder script for an email account (in qmail).

It's very convenient for users to be able to communicate with web applications (or businesses) via email, but it's not always easy for the employees of the company to respond. Some of the email requests could be complex, and others could be simple but occur very frequently. So it's a real advantage when we can write scripts to respond to user emails for us.

The tutorial sets up a basic structure for you to work from including places for the addresses and extra headers for the response. You can also download the code to have it to follow along with (or play around with yourself).

tagged: email autoresponder script qmail address header email autoresponder script qmail address header

Link:

Gareth Heyes' Blog:
Faking the unexpected
Dec 04, 2007 @ 08:36:04

Gareth Heyes has an example of yet another way he's seen developers incorrectly handle incoming connections and the information inside. This time, he focuses on the remote IP coming from the client.

Developers place too much trust in everything, they assume that certain data cannot be faked and therefore these pieces of data can be used as a Trojan horse. Lets take the REMOTE IP of a user, it seems a trusted source because of the TCP/IP connection between the user and the server.

He points out the difference between HTTP_X_FORWARDED_FOR and REMOTE_ADDR and how, despite them being the same almost all of the time, shouldn't be trusted since they could be spoofed. He even includes an example script showing how it could be done (and how a bit of Javascript can even be inserted).

tagged: remoteaddr httpxforwardedfor remote ip address exploit remoteaddr httpxforwardedfor remote ip address exploit

Link: