Skip to main content
CSS is fun and cool and I like it.
Article

A Follow-Up to PHP Templating

Not long ago, I posted about PHP templating in just PHP (which is basically HEREDOC syntax). I'm literally using that technique for some super basic templating I needed to do on this very WordPress site. The main pushback was that this kind of thing can be an XSS vulnerability. In my case, it's not, because I'm not using it for anything other than an abstraction convenience for my own hand-written strings.

Since then, we've had a couple of good articles … Read article

Article

PHP is A-OK for Templating

PHP templating often gets a bad rap for facilitating subpar code — but that doesn't have to be the case. Let’s look at how PHP projects can enforce a basic Model, View, Controller (MVC) structure without depending on a purpose-built templating engine.… Read article

Article

PHP Templating in Just PHP

With stuff like template literals in JavaScript and templating languages, like JSX, I've gotten used to wanting to write my HTML templates in one nice chunk and sprinkling in variables wherever I need them.

I had a situation where I needed to do that in "raw" PHP the other day, so I'm just documenting it here. … Read article

Article

PHP For Beginners: Building a Simple CRM from Scratch

Customer Relationship Management (CRM) is a system that manages customer interactions and data throughout the customer lifecycle between the customer and the company across different channels. In this tutorial, we are going to build a custom CRM in PHP, which a sales team can use to track customers through the entire sales cycle.

We'll be creating a simple CRM system for salespeople … Read article

Article

Adding and Leveraging a CDN on Your Website

If you’ve been working around web development for a while, you’ll know that the web has a need for speed. The truth is simple: speed matters and faster is considered better.

One "easy win" for increasing performance is using a CDN. We’ve discussed this several times at CSS-Tricks. It's easy in that you aren't rewriting a codebase or hand-editing content, but it's an area of performance many of us might overlook because, well, hosting, servers and cPanels, oh my!

Thankfully, … Read article

Article

PHP School (Learn PHP Through Command Line Workshops)

Whilst attending a local meet-up last year in Nottingham, UK, my friends and I were introduced to the concept of NodeSchool. NodeSchool workshops are small applications which run in the terminal and exist to teach you various topics related to Node and JavaScript. They range from teaching you the basics of JavaScript, all the way through to dealing with C++ extensions.

I had great fun and the workshops were really cool - you select an exercise, read the problem … Read article

Snippet

Start a Web Server With One Terminal Command on OS X

I've searched for this three times this week, so I figured I'd better make sure I have a copy of it.

Python 2:

python -m SimpleHTTPServer 8000

Navigate to the project directory in the terminal and do that command. Then http://localhost:8000 will server up that directory (as in, it's `index.html` file).

Python 3:

python3 -m http.server --cgi 8080

PHP:

php -S localhost:2222

npm:

npm i -g serve
serve
Read article
Article

PHP for Beginners: Building Your First Simple CMS

The Magic of PHP + MySQL

It's safe to say that nearly every website that's up-to-date these days is using some form of content management system (CMS). While there are a ton of great free options that provide us with a CMS to power a website (WordPress, Drupal, etc.), it doesn't hurt to peek under the hood and get a feel for how these systems work.

To get our feet wet as back-end developers, we'll be creating a simple PHP … Read article