Only some days ago PHP.net introduced 5.3.0RC1 version, but future features have been known for quite a while. Namespaces and lambda functions (+ closures) are most anticipated, because they’ll increase flexibility and good-looks of code a lot. Today I’m going to try to prove why lambda functions are so useful.
Because of “Functional Programming” course I [...]
Lambda functions are coming to PHP
Prevent scripts from being killed
Getting back to shared servers problems. I have some very time consuming scripts running through CRON – some nice web scrapping jobs. They are not processing-intense, but rather slow because of slow websites. All these jobs are really hard to divide in to separate scripts (another article), so one script should have no limits to [...]
HTML filtering and XSS protection
If you have been programming websites long enough you would know that user input is first think to worry about when thinking about security. It’s really hard to decide what data is acceptable, especially when user has permission to insert HTML content through form.
For example, if you are developing CMS you need to make sure [...]
PHP charting library JpGraph
Recently code-diesel posted 6 charting libraries, but I haven’t found JpGraph there. JpGraph was recommended to me some yeas ago by my good friend and I have been using it since then. It has some major disadvantages, but there are very big strengths also – all in this article.
Compared to other libraries, especially SWF [...]
Debugging with FirePHP and Firebug
One may debug his application with print(”) statements all other the place or alert(”) for JavaScript. Luckily some years ago Firebug extension for Firefox was introduced, which introduced (?) console. Console works absolutely the same as in Linux and can be used not only to execute commands, but receive information from various sources.
To start with, [...]
Starting with Zend_Search_Lucene
As websites grows, searches like “LIKE title ‘%search term%’” becomes unreliable. There are very good solutions like Sphinx, Lucene, etc, but not surprisingly, you can’t always have Sphinx installed (shared servers again) and other solutions should be chosen.
MySQL supports full-text indexing, but it doesn’t give a lot of control over actual index. Luckily, Zend [...]
Using AJAX with onSubmit event in jQuery
Last week I was working on one task, which required me to check data with AJAX when form is being submitted. Users clicks the button, request is made, data arrives, some hidden fields are modified, actual submit happens. The problem I ran into is, how to control form submission and ensure that it’s submitted only [...]
JSON – perfect data exchange format for AJAX
If you are using library such as jQuery, it supports AJAX responses in very different formats. For example, jQuery.get supports “xml”, “html”, “script”, “json”, “jsonp” and “text”. Which to choose?
Let’s say we have these variables, which we want to pass to JavaScript:
$array = array(
’status’ => ‘OK’,
‘message’ => ‘My status message’,
‘additional’ => array(1, 2, 3, [...]
Free Microsoft products? Yes
I’m not fan of Microsoft, but I’m not hater too. I stand in neutral position – I use Linux in my computer, but sometimes I use Windows for Photoshop, I’m programming using NetBeans, but sometimes I do it in Visual Studio (I’m preparing for C# and ASP.NET work).
When I started programming in C# some months [...]







