News Feed
Sections

News Archive
feed this:

Havard Eide's Blog:
SplObjectStorage
July 23, 2008 @ 08:47:44

Havard Eide has a recent post to his blog that looks at a part of the Standard PHP Library (SPL) that can be used with objects to store them for later use - SplObjectStorage.

In this post I will look at SplObjectStorage: a container that allows to store objects uniquely without the need to compare them one by one.

He lets the code to most of the talking, showing how to do the standard operations for a data store - adding objects (both unique and the same), updating objects in the store, checking to see if an object is already added and removing an object from storage.

0 comments voice your opinion now!
splobjectstorage add unique update check data storage object remove



Developer Tutorials Blog:
Port Scanning and Service Status Checking in PHP
June 10, 2008 @ 08:46:08

The Developer Tutorials blog has posted a new tutorial covering how to scan ports and checking a remote service's status with PHP.

Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

They show how to check a remote instance (a socket open with a timeout) and how to run through a list of ports, looping from one to one-thousand and running an fsockopen on each. They make a sample script to show these two combined - a simple page that loops through the common protocols (HTTP, FTP, SSH, etc) and checks to see if the remote machine is running something on that port.

0 comments voice your opinion now!
port scan service status check fsockopen http ftp ssh


Sebastian Nohn's Blog:
Using Net_DNSBL and Nagios to check if your SMTP server is listed in a RBL
October 05, 2007 @ 10:22:00

Sebastian Nohn has created a handy little script using PEAR packages to work with a Nagios installation to perform an automatic check - validating that your domain isn't listed with the given black lists.

RBLs are a great way to get rid of a lot of SPAM (if you choose the right ones). On the other hand you (and users of your mail server) get in big trouble if your SMTP server gets listed on a common RBL.

Checking this manually is a job that sucks a lot, checking this automatically is an easy job with Nagios, PHP, Net_DNSBL and Console_Getopt.

He includes the parts you'll need - grabbing the PEAR package, the PHP script to make the request and the changes you'll need to make to the configuration files to make it all work together.

0 comments voice your opinion now!
netdnsbl nagios smtp blacklist check pear package netdnsbl nagios smtp blacklist check pear package


Bjarte Karlsen's Blog:
My vim setup for editing php files
November 10, 2006 @ 10:16:00

For those PHPers out there that use the vi editor for their coding travels, Bjarte Karlsen has posted something that might help you out - two configuration files that he uses to work with PHP files in vim.

In a recent chat on #phpc we started discussing vim and talking about vim setups. Surripui posted a blog entry about this asking for setups. I promised that i would post my setup so here it is.

The two files are his:

Between the two of these, the editor is able to correctly handle PHP files, syntax check files and tab complete function names. There's also a mention of using gsnippets for working with code templates.

0 comments voice your opinion now!
vim editor tab complete syntax check gsnippets vimrc vim editor tab complete syntax check gsnippets vimrc


TopWebNews.com:
Web Services and PHP
August 19, 2006 @ 10:20:28

TopWebNews.com has posted a new tutorial today covering the creation and use of web services in PHP.

In this tutorial, I will be demonstrating how to use the SOAP package from PEAR to query Google's extensive database. This tutorial assumes that you are using PHP 4 or higher and PEAR::SOAP 0.8.1, and requires basic familiarity with PHP (including a little object-oriented programming).

He starts with the setup and configuration of the PEAR SOAP module to make the requests over to Google's backend. He also points you to the page to get a license key.

From there, it's all about the messages back and forth - decoding the WSDL file and sending the spell check request with the SOAP module. He even mentions a common issue some SOAP users will see - the value 'Object' instead of the correct return value (and, of course, how to correct it).

0 comments voice your opinion now!
pear soap package google request spell check license pear soap package google request spell check license


PHPBuilder.com:
PHP Filtering with OWASP
June 29, 2006 @ 06:15:37

On PHPBuilder.com today, there's a new tutorial that looks at a method to protect your PHP applications with the filters the Open Web Application Security Project provides.

OWASP (Open Web Application Security Project ) released a top ten list for web application security vulnerabilities in 2003 and 2004; you can find the latest information about their Top Ten Project here.

Most of the top ten vulnerabilities including (A1) Unvalidated Input, (A2) Broken Access Control, (A4) Cross Site Scripting (XSS) Flaws, and (A6) Injection Flaws, can be avoided by using these filters.

They walk through the installation before talking about the types of filters at your disposal - paranoid, SQL, system, HTML, int/float, UTF-8, and LDAP. The check() function looks at the inputted value to see if it passes the test (the other option the function takes).

They also give an example of combining filters as well, making more secure validation even easier.

0 comments voice your opinion now!
filtering security open web application project check types filtering security open web application project check types


PHPMac.com:
IP Banning
March 06, 2006 @ 07:18:29

PHPMac.com has posted a quick tutorial on how to "ban an IP" from your site.

Blocking certain IP addresses from your site is actually much easier than you might think.

In fact, it is only a seven-line code inserted at the top of your page!

The code basically just looks in an array of IP values and checks to see if the remote user's matches any of them. If it does, it echos out an error and stops the page execution. Obviously, this is just a basic example, and could be enhanced with a databse table that would be easier to manage than just the static array.

0 comments voice your opinion now!
php IP banning remote address check array stop execution php IP banning remote address check array stop execution


Nola's Blog:
Test Freak!
January 26, 2006 @ 06:37:20

In her latest post, Nola shares a testing class that she has created based on the Test::Simple method.

I'm writing a PHP class for a user, and then think.. oh gee, how do I know if this works?? oh I'll write a Test::Simple for PHP. Yes, I know there exists one already that uses the power of Perl to test PHP files, but I didn't have time to figure out how to set that up and probably won't be able to use perl anyways on the production system. I can't stand to have global variables, so I made a class. Uber simple. There's probably better ways to do it (I can imagine something much more elegant in PHP 5). But, what do you expect on a whim and 40 minutes...

her code runs a simple check to see if the end of the line being checked (passed in). It's a pretty basic testing framework, but has potential if it was made to accept "test plugins". Of course, there's other options out there too when it comes to testing in PHP...

0 comments voice your opinion now!
php testing Test::Simple check newline EOL php testing Test::Simple check newline EOL


WebReference.com:
How to Interact with Web Forms (Part 2)
January 24, 2006 @ 07:03:09

With a continuation of their previous article, WebReference has posted part two of their "How to Interact with Web Forms" series - an excerpt from the PHP Phrasebook (Sams).

They build on the previous code, showing how to:

  • preselect items from a multiple select list,
  • process image submit buttons
  • checking the mandatory fields
  • checking the values of select lists
They wrap it all up with two handy concepts - how to write out your data to a form and send it off in email form to the location of your choosing and working with the files uploaded via a form.
0 comments voice your opinion now!
php how to interact web forms select check require write file email php how to interact web forms select check require write file email



Community Events











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


zendframework application example job book releases security mysql developer release PEAR database code zend framework conference ajax package PHP5 cakephp

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