background preloader

PHP

Facebook Twitter

55 Awesome PHP Tutorials for Noobs. Upload File – Send HTML Format Email with Attachment Using PHP - Email Systems - php Magic Book. What this file does is uploads file in ‘temp’ folder then emails that attachment with message to a predefined email address and finally removes that file from temp folder.

Upload File – Send HTML Format Email with Attachment Using PHP - Email Systems - php Magic Book

The idea is to send email in rich format but with file attachment. Functionality. How to create chained select with PHP and jQuery. In this article we’ll talk about the chaining of select also called select cascade.

How to create chained select with PHP and jQuery

It is a procedure that we often find on the web and it consists in giving the user the possibility to find a specific data through a few passages: practically choosing a category in the first select, the second one will be populated with the results related with the category selected. We imagine, for example, a first select where it is possible to choose between motorcycles and cars; once we selected the car category , the second select will be populated with the brands of the cars available. Then selecting a brand, the third select will be populated with the models available of this brand. In this article we’ll see a very simple example but it will give us the basis to comprehend the procedure to do even in the case of more complicated cascades.

You can examine what we will create in this page of example. As you can see, the example is very minimalist. Create the structure of the database. Check your PHP code at every level with unit tests. It's 3 a.m.

Check your PHP code at every level with unit tests

Do you know if your code is still working? Web applications run 24x7, and wondering whether my application is still running has kept me up at night. Unit testing has helped me gain significant confidence in my code -- and get a good night's sleep. Unit tests are a framework for writing tests on code and running those tests automatically. Test-driven development is a unit test methodology that says that you first write the test and verify that tests find the errors, then write the code required for the tests to pass. PHP unit tests For PHP, the unit test framework is PHPUnit2. After you've installed the framework, you can begin writing unit tests by creating test classes that derive from PHPUnit2_Framework_TestCase. PHP Method Chaining, plus Magic Setters (similar to jQuery) Send Text Messages with PHP. Kids these days, I tell ya.

Send Text Messages with PHP

All they care about is the technology. The video games. The bottled water. Oh, and the texting, always the texting. Back in my day, all we had was...OK, I had all of these things too. PHP: Dynamic Image Generation. Creating images on the fly can be a very useful skill.

PHP: Dynamic Image Generation

PHP has some built-in image generation functions, further more, to generate new images or edit existing images on the fly using PHP, we need to have the GD library installed. In this tutorial we will show you how to get quite interesting and useful effects using image handling functions. We will review two practical tasks: creating security images (captcha) on the fly and building a bar chart using numerical values retrieved from MySQL database. Creating security images on the fly. Building a Bulletproof Contact Form with PHP. The web professional's online magazine of choice.

Building a Bulletproof Contact Form with PHP

In: Articles By Matthew Pennell Published on October 15, 2007 The humble contact form: It’s the cornerstone of nearly every website, from the humble personal blog right up to the corporate megasite—and a billion small business sites in-between. In the early years of operating a website, we were happy to put our shiny new email address out there for anyone to mailto, but the rise of the spammer has made us justifiably wary of publicizing our contact details—enter the contact form.

Setting the Groundwork. SQL Injection. Many web developers are unaware of how SQL queries can be tampered with, and assume that an SQL query is a trusted command.

SQL Injection

It means that SQL queries are able to circumvent access controls, thereby bypassing standard authentication and authorization checks, and sometimes SQL queries even may allow access to host operating system level commands. Direct SQL Command Injection is a technique where an attacker creates or alters existing SQL commands to expose hidden data, or to override valuable ones, or even to execute dangerous system level commands on the database host. This is accomplished by the application taking user input and combining it with static parameters to build an SQL query. PHP Payment Library for Paypal, Authorize.net and 2Checkout. Update: This library has gone through full re-write and the uploaded version can be found here.

PHP Payment Library for Paypal, Authorize.net and 2Checkout

If you are like me, whenever you need to work with a 3rd party API or a gateway, you’d first search in Google for a possible wrapper for it in PHP. When it comes to supporting payment gateways, you get bunch of libraries in the search results who are fundamentally different. Some of them are old PHP 3/4 ones, some are new, some may need PEAR, etc. As they were not required together in one single project, I used them whenever needed. But in one project, I needed them all. So, here is an abstract PaymentGateway library which is being extended to be used for three popular payment gateways (Paypal, Authorize.net, and 2Checkout) in order to provide you with a similar way of using them.

DownloadNo download available for this version. Paypal. PHP AJAX example: asynchronous file upload. Practical PHP Programming. 43 Must Read PHP Articles and Resources. Extremely useful PHP classes. PHP PSD Reader A few weeks ago, I wrote an article about this PHP which allow you to display any Adobe PSD file on screen.

extremely useful PHP classes

Very usefull to create preview of PSDs designed for clients, for example.Download Browser detect One of the most common (and boring) problem for front-end developers is definitely cross-browser compatibility. This PHP class will detect almost all browsers and simplify your cross-browser work.Download Akismet Remember those days without spam? ADOdb The large majority of websites and web apps are using databases to store all kinds of data. HTML Purifier. PHP for Beginners: Building Your First Simple CMS. The Magic of PHP + MySQL.

PHP for Beginners: Building Your First Simple CMS