A blog
2019-04-24 09:40
This is an experiment in minimalist HTML/CSS/JavaScript, and PHP. It might also be about other stuff, but for the moment it's experimental and a bit of a training exercise.
Credit where it's due: The layout and CSS is based on Chris Were's design blog: https://chriswere.neocities.org/design.html. I'm rather fond of dark background/white text, with other colors used sparingly as highlights. I might mess with this design, but for now it's easy, clear, and simple. Thanks, Chris.
Philosophy: Keep it simple and elegant. Avoid bandwidth-hogging bloated frameworks and libraries that slow page loads and complexify development. And get to the point.
I'll add features on the fly. Sometimes they may fail, but hopefully not too often. This is a work in progress.
Old Fart Learns PHP
2019-05-08 09:41
Two years away from web dev is an eon in Internet years. After 15+ years building enterprise web apps in ColdFusion and a little .NET, I got thrown into performance testing for a couple years (ugh!). I bailed out of that before my web skills completely evaporated.
So, can an old fart learn the new web? Where to start? What to do?
How about... Build a blog? How about a blog about building a blog, in the very blog that's being built, as it's being built? Brilliant! And, hey, you're lookin' at it right now! Up and running in PHP, with a MySQL database. Pardon me while I pat myself on the back.
It's pretty minimal, a little ragged around the edges. There's no commenting (yet), no admin interface (yet). Posts are currently just copy/paste directly into the database. But that's OK, it works, it's simple, and it's a step above coding the entire blog in straight HTML.
PHP is new to me, but so far it seems kinda comfy. It's like an old family rec room in the basement: homey, unpretentious, a little cluttered and quirky, but comfortable. It has everything you need, and gets the job done. Plus it's capable of running large enterprise-level apps. I'm starting to like it. And it's free. I like free.
Anyway, these posts will document progress on this very blog, and may include other random thoughts that pop into my head. It may not be high literature, but it's better content than what was previously here, which was lorem ipsum. But there's no way these posts could be better than the awesome and powerful Bacon Ipsum!
Switched from mysqli to PDO
2019-05-16 09:41
These words are now brought to you by PDO (PHP Data Objects), instead of mysqli as used previously.
Why was I using old and decrepit mysqli to connect to the database instead of new and shiny PDO? Because in my documentation of choice, mysqli is the first thing listed! Never discount the influence of the first thing you come across when searching for something.
Why use PDO to connect to the database?
-
The same code works with different databases (MySQL, SQLite)
-
More secure against SQL injection
-
More modern
Not that "more modern" by itself is an unqualified advantage, sometimes old stuff works just fine but old stuff may carry risks.
Like ferinstance, an old PHP 5.3-ish app I was troubleshooting recently. It worked fine for years and then suddenly didn't. Turns out the local ISP, a nice bunch of folks but a little casual, switched everything to a new server, running v5.6, without letting us know. The new server can't seem to properly run anything below PHP 5.4, and we can't migrate back to the old server because all that's left of it are backup files.
This is not unusual, there's lots of small but loyal old apps out there that are still being used because they get the job done, haven't actually broken, and there's nobody around to look under the hood and check the oil once in awhile. But the world keeps stumbling forward, and the plumbing behind the scenes gets updated, for good reasons, and stuff breaks. Such is the risk of old apps.
Anyway, we deployed the app temporarily to AWS running PHP 5.3, and all is well again. Meanwhile, by building this blog, I'm learning enough about PHP I can soon upgrade the old app to shiny v7+ newness.
Test DB entry 4
2019-03-24 09:42
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren
Test DB entry 5
2019-03-24 09:43
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.