Archive for March, 2006
Wednesday, March 29th, 2006
Ever been in a situation where you had to test mails from your web application but couldn’t get the mails properly? Here’s something for you :
Fakemail is a dummy SMTP gateway written in Perl. It’s a tool for testing applications that works by acting as an intercept for outgoing mails.
Fakemail works by intercepting the mail before it leaves the machine by replacing your mail transfer agent (MTA). It’s a simple script run from the command line and then killed when it’s captured the mails.
Mails are simply dumped to a directory of your choosing, here the a temporary directory, complete with all of the mail headers. Briefly, the port parameter is the port to listen on initially, the host parameter is not currently checked and the background flag tells fakemail to run as a daemon and to return the process ID of the detached process.
Link: Fakemail is an SMTP gateway replacement to make mail testing easier
Posted in Software, Web Development | No Comments »
Wednesday, March 29th, 2006
Here’s an interesting article on Ajax Applications and security. It won’t be long before content hijackers take over your XML data which you’re using for your Ajax applications.
If data is more openly available as XML over HTTP, it’s going to be pretty damn easy for a smart hacker to get access to that data to make applications like this impressive example… which is great, but undoubtedly someone eventually will feel like their data is being “stolen” or “misused”.
Link: Whirlycott - Philip Jacob » Security in an AJAX World
Posted in Ajax, Security | No Comments »
Monday, March 27th, 2006
Here’s a testing tool for web applications which is easy to use and has a firefox plugin to record and play test runs
was developed by team of programmers and testers at ThoughtWorks. Selenium is a test tool for web applications. Selenium tests run directly in a browser, just as real users do. And they run in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh. No other test tool covers such a wide array of platforms.
How does Selenium Work?
Selenium uses JavaScript and Iframes to embed a test automation engine in your browser. This technique should work with any JavaScript-enabled browser. Because different browsers handle JavaScript somewhat differently, we usually have to tweak the engine to support a wide range of browsers on Windows, Mac OS X and Linux.
Selenium IDE
Selenium is a test tool for web applications. Selenium tests run directly in a browser, just as real users do. And they run in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh. No other test tool covers such a wide array of platforms.
Link: Selenium: Selenium
Link: Selenium: IDE (Firefox Plugin)
Posted in Software, Web Development | No Comments »
Thursday, March 16th, 2006
An interesting article from IBM on using PHP with OpenLaszlo.
This “Spice up PHP applications with OpenLaszlo” tutorial series shows you how to use OpenLaszlo to create a more interactive interface for your PHP applications and how to use PHP to create more dynamic OpenLaszlo applications. It requires a basic understanding of — or willingness to learn — XML, JavaScript, and PHP. Each is well worth knowing for its own merits, plus they plug and play together nicely, since they’re all based on synergistic open standards.
On the server side, PHP is a widely supported scripting language that produces and reads XML data, interfacing easily with relational databases and other programs. PHP is great for implementing AJAX applications with service-oriented architectures. And it’s a smart choice for integrating Web services that use common Internet protocols, such as HTTP, XML-RPC, Simple Object Access Protocol (SOAP), and Representational State Transfer (REST).
On the client side, OpenLaszlo is an elegant XML-centric, JavaScript-based Web programming language. It’s designed for implementing interactive, media-rich, distributed, user-friendly interfaces to XML-based Web services. For programmers, the OpenLaszlo language is fun and feature-rich. For users, OpenLaszlo applications are richer and more responsive than conventional browser-based applications. (See Resources for available OpenLaszlo applications.)
Link: Spice up PHP applications with OpenLaszlo, Part 1: Create interactive interfaces (requires free registration to view)
Posted in PHP, Web Development | 2 Comments »
Tuesday, March 14th, 2006
A tutorial from phpmagazine.net which show you how to create an online visitor display using PHP and Ajax.
“There is many techniques to track online visitors with PHP, in this example I used the most simple one. The script check the sessions online and then consider the recent ones in an interval of about 3 minutes. This gives more realistic information, because visitors idle for a long period are considered not online, and in the same time we don’t have to create complex script and store informations in database”
Link: AJAX Magazine: AJAX Real Time Online Visitors Tutorial
Posted in Ajax, PHP | No Comments »
Tuesday, March 14th, 2006
Here’s a cool comic strip for PHP developers.

Get more of PHP Life at: < ?PHP Life?>
Posted in Sites | No Comments »
Thursday, March 9th, 2006
Here’s an interesting article on Email Header Injection, a method spammers use to hijack your contact forms to send our mails. The article goes on to show how to protect the contact form from being abused.
It has become apparent that spammers are getting even smarter than we take them for. Rather than abuse open relays, which are almost non-existent, these scum-of-the-earth ‘traders’ are now abusing contact forms.
Link: Jelly & Custard » Email Header Injection in PHP
Posted in PHP, Security | No Comments »
Wednesday, March 8th, 2006
By: Jacob Manser (lefteh)
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:
1 : < ?php
2 : $banned = array("24.91.102.173", "64.21.162.113");
3 : if (in_array($_SERVER['REMOTE_ADDR'], $banned)) {
4 : echo "You have been banned.";
5 : exit;
6 : }
7 : ?>
Please note that the used IP addresses are randomly selected numbers.
Now, for the explanation of the code.
- Line 1 simply opens the PHP code.
- Line 2 sets the variable $banned to an array containing all the IP addresses you want to be blocked from your site.
- Line 3 opens a conditional. The conditional uses the in_array() function. This function checks if the first argument is in the second argument, which is an array. Our first argument, $_SERVER['REMOTE_ADDR'], is automatically set to the viewer’s IP address.
- Line 4 echoes the message “You have been banned” if the user’s IP address is in the array $banned.
- Line 5 exits the page, not executing any code below line 5 if the above conditions are met.
- Line 6 ends the conditional.
- Line 7 ends the PHP code.
So, if you are implementing this code into your page, just put it above the HTML tag like below:
< ?php
$banned = array("24.93.100.113");
if (in_array($_SERVER['REMOTE_ADDR'], $banned)) {
echo "You have been banned.";
exit;
}
?>
And that is the simple code that blocks chosen IP addresses from your site.If you need any further assistance, you can contact me:
iChat: bushisah8er
Email: lefteh@gmail.com
Published via PHPmac - IP Banning through a Creative Commons License
Posted in PHP, Security | 2 Comments »
Wednesday, March 8th, 2006
Here’s a framework for Ajax which is trying to make Ajax programming a lot easier and simpler. My-BIC provides support for XML, JSON and Text based Ajax transactions and works on Safari, Firefox, IE and Opera.
Submitting forms with ajax used to be a pain, you had to create your own query strings and send it to the server… no longer with My-Bic. Watch how easy sending a form with 20, 30, 40, 50 or more fields is:
1.
2. var formVars = ajaxObj.getForm('yourFormID');
3. ajaxObj.call('action=postComment' formVars);
4.
That is it my friend! You just create your form with an ID and pass it on in and My-Bic will do the rest. It supports text, textarea, checkboxes, radios, single select, multiselect, arrays, and passwords! To PHP it will look the same as any other form variable submitted to your website. Check out the demo Forms Test
Link: My-BIC = Easy Ajax
Posted in Ajax | 3 Comments »
Wednesday, March 8th, 2006
Ever been in a situation where you couldn’t access sites because your ISP or sysadmin has been blocking access. Here’s your chance to set up your own proxy server to bypass the firewalls and proxy. If you’ve got access to an external server with Apache and PHP installed, head over and get PHProxy and install it on your server.
PHProxy is a Web HTTP proxy programmed in PHP to bypass firewalls and other proxy restrictions through a Web interface very similar to the popular CGIProxy. School/country/company blocked your favorite Website?
Link: PHProxy - Anonymizing PHP Web Proxy
Posted in PHP, Software | 3 Comments »