Tag Archives: PHP

MODX Force SSL On A Specific Page

Add the below as a snippet, and include it BEFORE any output can happen on the page. ?View Code PHP<?php if($_SERVER["HTTPS"] != "on") { header("HTTP/1.1 301 Moved Permanently"); header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); exit(); } ?>

PHP Code Get Most Recent WordPress Post

PHP Code Get Most Recent WordPress Post This is a quick example using only vanilla PHP.  There are more dynamic ways to do this using RSS classes built into PHP addons, which I won’t go into detail here.  Instead, we will just use vanilla PHP, and parse the XML by hand. On to the code, [...]

Don’t Write Code In The Dark

Don’t Write Code In The Dark… I may be showing my age a little bit here but I remember watching Are You Afraid Of The Dark? on Nick as a kid.  It was quite a cheezy show, but hey what do you expect. Do you know what happens to people during sensory deprivation? (A brief [...]