background preloader


Facebook Twitter

Guzzle - PHP HTTP Client. As you probably know, website development can be broken up into 2 main areas: Front end (what the end user sees)Back end (what the server has to do in order to provide the requested data) While front end development frequently uses several data sources to display a page, simple dynamic sites would only depend on data coming from a database hosted on the same server.

Guzzle - PHP HTTP Client

As back end developers today, we are in need of retrieving data from a database server on a different host, or consuming an API from a third-party provider, while making it look like everything happened in our server. Menu PHP. PHP jQuery Dynamic Textbox July 21, 2014 This tutorial helps to add or remove textbox dynamically using jQuery and PHP.

Menu PHP

It also describes how to read the values of dynamically created textboxes and save them to the database. Save textbox HTML in separate file. Load and append dynamic textbox. Ajax Image Upload and Resize with jQuery and PHP. You may find plenty of great image uploader on the net, but they are also very complicated to configure and to implement without the help of professionals, especially if you are novice one.

Ajax Image Upload and Resize with jQuery and PHP

Those uploader comes with additional functions which you may not even need, so sometimes your best bet is to create your own image uploader, which will serve the purpose and keep things simple. Today we are going to create an Ajax based image uploader, which means the image file will be uploaded to server using Ajax request, without reloading the page. We will also be using HTML5 File API to check file size and image type before uploading, then with PHP support we will create two images, a re-sized image and square thumbnail out of the original file. The examples you’ll find here are pretty basic and easy to understand. HTML Image Upload Form. Taking Ajax further with PHP « Blog « Peter Upfold. Find this tutorial useful?

Taking Ajax further with PHP « Blog « Peter Upfold

First of all, I have to apologise. It’s been literally two months since my last post in this series, and it’s been more than that since I last looked at Ajax in PHP. OK, I might admit it, it was this comment that motivated me to pick up this series again. Oh, that and I’m now on the half term break, so I’m finally getting round to some things that have been on the back burner for a long time. In our last Ajax tutorial, we got started with Ajax using PHP and made our first Ajax application. Today, we’re going to take Ajax a little further, by building a little application where our user selects a product from a pop-up list, and then we do a little Ajax dance to get some product details (and an image) and display them in a box below.

Requirements For this tutorial, you’ll need the following (and in brackets, I’ll show you what I’ll be using): All code in this tutorial is released under the Modified BSD Licence. Download .zipDownload .tar.gzDownload .tar.bz2. Building Web Applications from Scratch with Laravel. 10 Common PHP Coding Errors. PHP makes it relatively easy to build a web-based system, which is much of the reason for its popularity.

10 Common PHP Coding Errors

But its ease of use notwithstanding, PHP has evolved into quite a sophisticated language with many frameworks, nuances, and subtleties that can bite developers, leading to hours of hair-pulling debugging. This article highlights ten of the more common problems that PHP developers need to beware of. Common Mistake #1: Leaving dangling array references after foreach loops Not sure how to use foreach loops in PHP? Using references in foreach loops can be useful if you want to operate on each element in the array that you are iterating over. $arr = array(1, 2, 3, 4); foreach ($arr as &$value) { $value = $value * 2; } The problem is that, if you’re not careful, this can also have some undesirable side effects and consequences.

The main thing to remember is that foreach does not create a scope. Here’s an example of the kind of evasive and confusing bugs that this can lead to: Why? Not. Output: Common PHP Mistakes. I was recently asked by one of my readers to give feedback on the following article he read: 10 Most Common PHP Mistakes.

Common PHP Mistakes

It is well written and very thorough. Most of the tips are specific to PHP, others are about web programming in general or database performance. It’s a very good read. Head First PHP & MySQL. If you're ready to create web pages more complex than those you can build with HTML and CSS, Head First PHP & MySQL is the ultimate learning guide to building dynamic, database-driven websites using PHP and MySQL.

Head First PHP & MySQL

Packed with real-world examples, this book teaches you all the essentials of server-side programming, from the fundamentals of PHP and MySQL coding to advanced topics such as form validation, session IDs, cookies, database queries and joins, file I/O operations, content management, and more. Head First PHP & MySQL offers the same visually rich format that's turned every title in the Head First series into a bestseller, with plenty of exercises, quizzes, puzzles, and other interactive features to help you retain what you've learned. Throughout the book, you'll build sophisticated examples — including a mailing list, a job board, and an online dating site — to help you learn how to harness the power of PHP and MySQL in a variety of contexts.

Table of Contents 1. We use MySQL. 25 Essential PHP Functions. This is a list of 25 interesting PHP functions that are useful in a variety of situations.

25 Essential PHP Functions

Please do not make changes to the actual set of functions without first discussing them on the talk page. Function list[edit] Following is the raw list of 25, in alphabetical order: Ceil()[edit] float ceil (float value) Rounds up the supplied float value to the next integer and returns the result. Usage[edit] Practical applications[edit] Can be used to check if a number divides evenly with another - for example: See also[edit] Floor() - Rounds down the supplied float value to the next integer and returns the result.

Count()[edit] int count (mixed var) Returns an integer value of the number of elements in the supplied variable - generally an array, as anything else will return 1. Usage[edit] Practical applications[edit] Handling every element of an array - for example: Bear in mind that this could be done without count() using the foreach case structure anyway. Die()[edit] void die ([string status])