background preloader

Php

Facebook Twitter

Manage Your Content With PHP. In this article, we’ll build a simple, template-driven site that separates style, content, and structure in your website.

Manage Your Content With PHP

We’ll create a cross-browser stylesheet switcher that remembers the user’s preferences, touching on php variables, cookies, if statements, and including pages with require_once. Separating style, content, and structure#section1 Article Continues Below The separation of style from content has become the bugbear of the HTML developer. Traditionally, we’ve used well-written CSS and XHTML to achieve this separation, and we’ve seen how much easier it is to update our sites or provide multiple styles when we write our markup this way. PHP is an open-source server-side language. Essentially, the master template will use XHTML for structural markup, CSS for style, and some basic PHP to manage it all. Client-side languages like JavaScript do their work on the client—the browser—so the success of a page built with JS depends on the quirks of the individual browser.

<? Sending Emails in PHP with PHPMailer. PHPMailer is one of the most popular open source PHP libraries to send emails with.

Sending Emails in PHP with PHPMailer

It was first released way back in 2001 and since then it has become a PHP developer’s favorite way of sending emails programmatically, aside from a few other fan favorites like Swiftmailer. In this article we’ll talk about why you should use PHPMailer instead of PHP’s mail() function and we’ll show some code samples on how to use this library. In most cases, it’s an alternative to PHP’s mail() function, but there are many other cases where the mail() function is simply not flexible enough to achieve what you need.

First of all, PHPMailer provides an object oriented interface, whereas mail() is not object oriented. Php - PhpMyAdmin mbstring error. How to Automatically Linkify Text with PHP Regular Expressions. Good software enables us to take a lot of niceties for granted.

How to Automatically Linkify Text with PHP Regular Expressions

Intelligent interfaces handle all the simple tasks so that we don’t need to worry about them. For example, when I type “www.desktopped.com” into an email or an instant message, I expect that it will be clickable on the other end without having to manually add in HTML tags. Another example is parsing text from a twitter feed. For example, “@desktopped is a blog about the #computers“, we expect both @desktopped and #computers to be links. Create a Simple Picture Gallery using PHP. By Patrick Lin In this post I will show you how to create a simple picture gallery using PHP.

Create a Simple Picture Gallery using PHP

This will go through all the pictures in a directory; if a thumbnail does not exist for it, create one for it; and display the thumbnail on a page with the ability to show the full sized pictures. I am going to use the PHP GD library, so make sure that your web server has the GD Library enabled. View a Demo Download the Files First of all, you can check if you have the GD Library enabled by creating a file with the contents: If you can find ‘gd’, then the GD library is enabled. Creating a simple image gallery with PHP & jQuery. How to setup The Plan of Action.

Creating a simple image gallery with PHP & jQuery

CSS Lightbox Made Practical With PHP. In my recent book on advanced CSS3 (may as well get the inevitable plug out the way early), I described how we can use CSS3 to develop a genuine lightbox solution, without the help of any JavaScript.

CSS Lightbox Made Practical With PHP

I also mentioned the pitfalls of this technique, which unfortunately outweigh the benefits and therefore make it an unrealistic option in the real world. Until now. The major flaw was the amount of repetitive HTML required and the fact that it would be ridiculously difficult to maintain if you had to make any changes. Well in this post, I’m going to show you how you can use PHP to do the work for you and in turn, transform this technique from heavy and intricate to light and friendly. Most importantly, the use of PHP will make the lightbox an absolute breeze to maintain. So here’s how this is gonna go down… Take a look at the demo and then we’ll get started. 1. First things first; we need to create the thumbnail gallery, and we can do so using some very familiar and unexciting markup. 2. 3. 4. The Basics of Creating a CMS with PHP. When people want to build a website for someone, they usually need to create a Content Management System (CMS) that allows the client to manage their own content.

The Basics of Creating a CMS with PHP

And while there are thousands of prebuilt CMSes that can get the job done, it can be very helpful to learn how to build one yourself. What a CMS should do They don't have to be extremely difficult and should only do as much as needed. If your grandmother wants a website to sell pies, then she only needs a way to add, update and remove various flavors. How To Use Lightbox With A Database. Today I’m gonna show you how to use Lightbox while getting photo information from your database.

How To Use Lightbox With A Database

I think this is great if you wanna have something like a dynamic photo gallery in your site. Step 1: Prepare your Database. We’ll have something like this: Step 2: Download Lightbox here.Step 3: Unzip it on your web directory.Step 4: Prepare your database configuration file. I have config_open_db.php file, just for database connection.Step 5: Create a images folder, we’ll assume that your photos are stored here. There are also lots of things that you can configure in jQuery Lightbox such as overlay background color, opacity, navigation behavior, button images, border size, resize speed, keyboard navigation, and etc. PHP. 50 Essential PHP Tutorial and Examples for Beginners.

Those essential php tutorial and examples are important for beginner and advanced web developer to find out more about php script and project.

50 Essential PHP Tutorial and Examples for Beginners

Some tutorial also have example source code that you can download free. It is really important basics of programming with PHP to find truly tutorial with examples for easy download and testing. In addition, PHP is one of the most popular server running side scripting languages today. Lessoncup Programming Blog. Learning OOP in PHP ASAP! Remove duplicates from Database Using PHP. Last Updated: March 19, 2013 Deleting duplicate entries from the database is tricky, there are different queries to find duplicates in the database, but removing duplicates from the database is not that easy.

Remove duplicates from Database Using PHP

This little article will help you remove duplicate entries in a controlled way. Here are the benefits of using this technique. 40+ Invaluable PHP Tutorials and Resources. PHP 101: PHP For the Absolute Beginner. [box] For a complete list of Zend Training Courses – PLEASE CLICK HERE ! [/box] This area is intended for everyone new to PHP.

It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. A Beginner's Guide to PHP Programing. PHP is a server side scripting language used on the Internet to create dynamic web pages. It is often coupled with MySQL, a relational database server that can store the information and variables the PHP files may use. Together they can create everything from the simplest web site to a full blown business web site, an interactive web forum, or even an online role playing game. Learn more about PHP. Before we can do the big fancy stuff we must first learn the basics from which we build on. Start by creating a blank file using any program that can save in plain text format. How To Create Youtube Video Gallery in PHP - CodeRiddles.

PHP for Beginners: Building Your First Simple CMS. Object-Oriented PHP for Absolute Beginners.