JavaScript Change the Text of a Div Element using JavaScript December 23, 2022 / December 23, 2022 by Philip Newman | Leave a Comment Use the textContent property to change the text of a div element, e.g. div.textContent = 'Replacement text'. The textContent property will set the text of the div to the provided string, replacing any of the existing content. Here is the HTML for the examples in this article. index.html And here is the related JavaScript code. index.js We used the textContent property on the div to change its text […] Read more » HTML5 JavaScript
PHP Validate Password Strength using PHP November 2, 2022 / January 2, 2025 by Philip Newman | 1 Comment on Validate Password Strength using PHP When the user provides their account password, it is always recommended to validate the input. Password strength validation is very useful to check whether the password is strong. A strong password makes the user’s account secure and helps to prevent account hacking. Using Regex (Regular Expression), you can easily validate the password strength in PHP. […] Read more » password PHP PHP 8.1 preg_match
Linux Backup a website using bash script. April 8, 2022 / April 8, 2022 by Philip Newman | Leave a Comment I needed to complete a routine backup of my development websites on my home server. This was pretty easily completed by daily by a bash script. Here is a simple script that backs up the database and all the files. For the example below I’m using Maria DB 10.5 and my project files are located […] Read more » Backups Bash
PHP An Introduction to Classes and Objects in PHP 8+ February 6, 2022 / February 6, 2022 by Philip Newman | Leave a Comment What is OOP? Object-oriented programming (OOP) is a computer programming model that organizes software design around objects rather than single functions. An object can be defined as a data field that has unique attributes and behavior. A class is a container for objects to be manipulated using methods (internal functions). OOP Let’s assume we have […] Read more » PHP PHP 8.1
WooCommerce Wordpress StoreFront – Add HTML to header January 6, 2022 / January 6, 2022 by Philip Newman | Leave a Comment Read more »
WooCommerce WooCommerce – Display “Out of Stock” on Loop Pages September 17, 2021 / September 17, 2021 by Philip Newman | Leave a Comment This fixes a problem for those who want to display a label when an item is out of stock. You can save this in your functions.php to make it work. You will also need to add this to your style sheet. Read more »
WooCommerce WooCommerce – Sort Catalog by Stock Status September 17, 2021 / September 17, 2021 by Philip Newman | Leave a Comment A quick code snippet to allow you to sort your catalogue products by Instock/Out of stock. Read more »
Wordpress Publishing WordPress site from development to production. September 2, 2021 / September 2, 2021 by Philip Newman | Leave a Comment You have finished that WordPress site, and want to deploy it – move it from your test server to the production server where it goes live. But how? WordPress have a famous 5-minute-install, but there is no 5-minute-go-live-script*. I’ll show you how in these 5 easy-to-follow steps. Going live really isn’t that difficult, as long […] Read more »
Postfix Block entire TLDs with Postfix. December 22, 2019 by Philip Newman | Leave a Comment Situation: Your mail server has become busy processing SPAM messages from all the new top level domains. Almost all the email coming from the new .top .xyz .link .party domains are SPAMMY. None of your clients send email from any of these domains and it’s not expected that any of their clients would either. Solution:Block […] Read more »
Dovecot POP3 mail vs IMAP. October 7, 2019 / October 7, 2019 by Philip Newman | Leave a Comment POP3 and IMAP are two different protocols (methods) used to access email. POP3 POP3 is short for Post Office Protocol. POP3 downloads email from a server to a single computer, then deletes it from the server. Because your messages get downloaded to a single computer or device and then deleted from the server, it can appear […] Read more »
Postfix Multiple Sending IP With Postfix 3 September 23, 2019 / December 22, 2019 by Philip Newman | Leave a Comment Situation:Your single mail server only has one IP and it has started getting blocked by some of the bigger players like Yahoo, Hotmail and Gmail. You know all your email being sent is legit but it’s still being blocked. You’ve slowed the rate of your outbound messages quite a bit… but your mail queue is […] Read more »
Dribble Hello world! May 3, 2019 / August 10, 2019 by Philip Newman | 1 Comment on Hello world! I used to blog quite a bit but then suddenly it stopped. With time speedily slipping past and a BIG overseas trip planned I’ve decided to give myself a bit of a push into the deep end. Read more »