 | News Feed |
Sections
|
| feed this: |  |
Havard Eide's Blog: SplObjectStorage
by Chris Cornutt 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.
voice your opinion now!
splobjectstorage add unique update check data storage object remove
Developer Tutorials Blog: Port Scanning and Service Status Checking in PHP
by Chris Cornutt 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.
voice your opinion now!
port scan service status check fsockopen http ftp ssh
TopWebNews.com: Web Services and PHP
by Chris Cornutt 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).
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
by Chris Cornutt 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.
voice your opinion now!
filtering security open web application project check types filtering security open web application project check types
Nola's Blog: Test Freak!
by Chris Cornutt 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...
voice your opinion now!
php testing Test::Simple check newline EOL php testing Test::Simple check newline EOL
|
Community Events
Don't see your event here? Let us know!
|