Browsing articles in "PHP"
Jul
11
2014

Templated HTML Email with PHP using PHPMailer

Today we’re going to talk about sending amazing, templated, parsed HTML emails using PHP and the PHPMailer class. I know it sounds trivial- “Oh sure! Let’s send some messages!”, however, I do get a ton of requests for assistance when dealing with email templates and parsed content within those templates, so I figured this would be a good thing to write about! Background When I refer to email templates, I’m referring specifically to chunked, individual […]

Jun
24
2014

Download Files with PHP (From a List)

Ever have one of those days where you get a new codebase on your desk, but realize that you’re missing ALL THE IMAGES?  (face slap). I’ve had plenty of those, and here’s how to stop slapping yourself and just use PHP to download files from a list in a text file! The Directory Structure Easy enough, but just to be safe, the following is the directory structure used for this: process.php attachment.txt files/ Process.php The […]

Jun
24
2014

PHP Error Reporting and Why You Should Care

If you’re a PHP developer, and you prefix questionable function calls with the “@” symbol, you should be aware that I’m onto you!  If the first line of code you write after <?php is “error_reporting(0);”, then we shouldn’t be friends anymore.  Error reporting in PHP is really really really important, and you should probably also stop reading, because this article will just fill your soul with rage. Keep in mind, this article isn’t about whether or […]

Jun
22
2013

Retrieving Facebook Open Graph Data with PHP

Ever wonder, “Huh, I have a company page on facebook, but DAMN it’s lame to have to login to se the stats”?  I did, and as always- let’s grab some data with PHP! CODE! At the core of nearly anything you want to do with the facebook open graph is this url: https://graph.facebook.com/(username or id) And really, this doesn’t get a whole lot longer for the basics, we just need to use file_get_contents and json_decode […]

Jun
20
2013

Javascript and CSS Minification Class- MagicMin

MagicMin is css and js minification so awesome, you'll be like mini me!

A long long time ago, I wrote about using PHP to merge and minify javascript and CSS.  And it sucked!  It forcefully recreated the files each and every time the page was loaded, failed to compress or minify javascript files properly (resulting in some super duper errors), and overall was lame. It was however, short, so at least it had that going for it, which my actually awesome new class “MagicMin” does not have (it […]

Jun
17
2013

Getting started with PHP Functions

As I’m sure anyone who has visited this site more than a single time knows, I love php functions!  They make repeated processes and actions a breeze to initiate and take effect without having to copy-paste the same block of code into 25 different pages.  Then g-d forbid you should need to make a change to how it operates, or even worse- it’s just generally terrible and needs a full do-over! The day I discovered […]

Jun
12
2013

Getting Started with PHP: Part 2

Continuing the tutorial series on getting started with PHP (see “Getting Started with PHP” for the last batch), today I’ll provide some information on… Including external files Assigning PHP variables and constants Overview of variable and constant usage Including External Files PHP allows us to include external files that allow us to decrease the amount of redundant/repeated code used, as well as a security measure for important files such as files containing database connection details, […]

Jun
10
2013

Getting Started with PHP

I figured that since I spend most of my time buried DEEP in complex php functions, classes, and tips, it may be helpful to provide some background on what the hell you’re actually supposed to do if you have no idea! That being said, I’m going to begin adding some more introductory content that will hopefully provide some insight and tips on where to get started, so that you can more effectively work with more […]

Jun
8
2013

Awesome Email open tracking with PHP and MySQL

Sometime last year, I wrote about super awesome email open tracking using PHP and MySQL, and I’ve since ALSO updated that one to be EVEN MORE SUPER AWESOME! Tracking email open rates is both very valuable, and very useful, particularly if you run a service where statistics are important, or in scenarios where more detailed information on users (namely their participation with site content outside the website is crucial). That being said, a couple things […]

Jun
7
2013

Updated MySQLi Database Class

Since I posted my mysqli database class originally on February 18th, I’ve gotten some great feedback, and A LOT of downloads, which is amazing! As a side note, I recommend always grabbing this class from the github repo at https://github.com/bennettstone/simple-mysqli I’ve also been using my own class on a large number of websites, and through the course of normal usage, and user feedback, I have made some changes… The error reporting has been enhanced to […]

Pages:123»