Skip to content

Tag: PHP

PHP, JSON and JavaScript usage

Today i want to introduce you to jSON (JavaScript Object Notation), in short, it is a simple format designed to exchange data between different programming languages. I will show you how to create JavaScript object, convert it to JSON string, and send to PHP script, which will decode jSON string to readable format (for PHP). But that’s not all, PHP script will create it’s own data object encode it to jSON string and send it back. All communication between JavaScript and PHP will be done thru AJAX. Continue reading PHP, JSON and JavaScript usage

Clean input variable PHP

Some time ago i wrote a post about query string and i think i pretty well covered that topic, however i didn’t mentioned one thing … cleaning input variables. In fact it is much more important to know how to clean $_POST and $_GET arrays then know how to handle query string, because variables sent by user are the only way to hack your script, it is that simple, if you take care of input variables then your script is 100% safe.

Continue reading Clean input variable PHP

Using PHP cURL to read RSS feed XML

I very rearly, use feeds, i prefer to go to my favourite website and see what is going on instead of downloading their content to my computer with some RSS reader. However the fact is feeds are getting popular and people are searching for a ways to access and easily automatically parse those feeds with PHP, and because RSS and ATOM are nothing more then XML documents then i have for you really simple way of handling those feeds which i want to share with you (thru my blog as well thru my blog feeds :)). Continue reading Using PHP cURL to read RSS feed XML

How to create WordPress Plugin from a scratch

WordPress blogs are getting more popular then ever, there are literally hundreds of new weblogs popping up everyday. However WordPress is not a new software, so I think it is about time to learn how to create decent plugins for it, and once you learn how to write plugins you will discover that this is not only fun but can be very profitable as well.

Continue reading How to create WordPress Plugin from a scratch

Creating watermarks with PHP and GD Library

The last post i wrote was about getting started with GD library, today i want to show you practical use of this wonderful library. I want to protect all images on my server, so i need to create watermarks for all my images, but let’s pretend i want to sell this images at the same time so there cannot be any watermarks on it. There are two solutions to this problem: create images with and without watermarks or use GD library and create watermarks on the fly. Obviously we will take advantage of the second method because it is more professional and requires less work in the end.

Continue reading Creating watermarks with PHP and GD Library