burger menu icon
WillMaster

Latest at This Website

Here are introductions to the 11 most recent items:

Count Specific Characters in a String
16 November 2026, 14:47:42 UTC

The PHP substr_count() function counts how many times specified characters occur in a string.

In other words, it can tell you how many times "stan" occurs in a word or sentence. Or how many times "a" occurs.

As examples, substr_count("substantial","stan") returns the number 1 and substr_count("substantial","a") returns the number 2. There is only one occurrence of "stan" in the string "substantial." And there are two occurrences of "a" in that string.

My use of substr_count() generally is to determine if an amount contains exactly one period, a percentage contains a "%" character, or an email address contains exactly one "@" character. Those types of things. But its use surely is not limited to that.

(The complete article is at https://www.willmaster.com/library/web-development/count-specific-characters-in-a-string.php)
Submit Form Using Ajax
9 November 2026, 12:54:29 UTC

When you submit a form using ajax code, it is done silently. In other words, it is non-interruptive for the website user.

The person who submits the form receives no messages from the ajax unless you specifically tell it to.

(The complete article is at https://www.willmaster.com/library/manage-forms/submit-form-using-ajax.php)
CSS em Vs rem
3 November 2026, 18:46:58 UTC

The two most used font size-relative measurements in CSS are em and rem. Both refer to the width of the capital letter "M" in traditional fonts, like Arial. The font size affects the width.

Measurement 1em is relative to the size of the font being published. Size 2em is twice that.

Size 1rem is the width of the letter "M" at the browser's default font size.

(The complete article is at https://www.willmaster.com/blog/css/css-em-vs-rem.php)
Image Sepia Soak
24 October 2026, 20:11:18 UTC

When an image seems too cold or harsh, soak a bit of sepia into it for some warmth. Sepia is a yellow/brown color, with a hint of red.

I enjoy working with images. Which is a funny thing to say for someone who is colorblind, huh? I'm only certain-colors colorblind.

In this article, I'll show you how to use CSS to imbue the color sepia into images.

(The complete article is at https://www.willmaster.com/blog/javascript/image-sepia-soak.php)
Access-Restricted Page
19 October 2026, 16:44:15 UTC

Let's say you have a content page for only one or a few people. Perhaps a download link. Or a secret message. Something.

You want to keep search engines out of it. And also AI slurpers.

Also a log file so I can see when it has been accessed.

And, yes, it should be simple.

As long as we're at it, can it please work without cookies?

If you're smiling, and even if you're not, today's article provides the code for that.

(The complete article is at https://www.willmaster.com/library/security/access-restricted-page.php)
Image Swap
12 October 2026, 15:22:38 UTC

An image tag may swap images at a specified pace. No built-in maximum number of swap images.

(The complete article is at https://www.willmaster.com/library/features/image-swap.php)
Tap Only Once
6 October 2026, 16:34:42 UTC

Occasionally it is important to allow only one tap on a web page element. A form submit button, for example, which this article describes how to do.

To prevent a second tap on something, what was tapped needs to disappear. It might just go poof, or it might get covered. This article describes how to make it go poof.

(The complete article is at https://www.willmaster.com/blog/javascript/tap-only-once.php)
No-Menu Page Printing
29 September 2026, 20:48:53 UTC

Site users can print your web page. (Unless you prevent it. One way is described at the How To Prevent Web Page Printing page.)

So, if you don't actively prevent your web page from being printed, users can print it.

I recently had a need to allow printing of entire pages — to actually suggest it can be done. But I didn't want the menu printed. How to prevent a page menu from printing is the subject of this article.

The web page willbontrager.com/recipes/ has a live example.

(The complete article is at https://www.willmaster.com/library/features/no-menu-page-printing.php)
Mouseover Image Brightness Change
19 September 2026, 16:39:38 UTC

When a mouse goes over an image, the image can change its brightness. When the mouse goes elsewhere, the image brightness can be restored.

The CSS is the filter:brightness() declaration. The img attributes are onmouseover and onmouseout.

(The complete article is at https://www.willmaster.com/blog/javascript/mouseover-image-brightness-change.php)
Readonly and Disabled Form Fields
14 September 2026, 14:32:47 UTC

When you have a form with fields you don't want the user to change, there is a choice of two attributes built into HTML to accomplish that.

The two attributes are readonly and disabled. They have only one thing in common: preventing field value change. Otherwise, each is unique.

(The complete article is at https://www.willmaster.com/blog/html/readonly-and-disabled-form-fields.php)
Embedding Images Within Lines of Text
8 September 2026, 17:17:53 UTC

Most of you have embedded an image within text. You have a paragraph of text, and you embed an image within it the same size as the text.

If you use height:1em; for the image, it may open up the interline spacing. That's because 1em includes the descenders. The base of the image doesn't start that low. Thus, it sticks up above the actual text. (There is a way to avoid that, mentioned shortly.)

Manually specifying a pixel height for the image can be done. But if it is too small, it looks dinky. Too large, and the image expands the interline spacing. If you decide to change the text font size, you may need to resize all those images.

That is, unless you specify the CSS declarations height:1em; vertical-align:text-bottom; within the img tag.

The vertical-align:text-bottom; CSS declaration moves the image down so the bottom of the image is in line with the bottom of the text descenders. Now a 1em tall image won't stick above the top of the text. And the interline spacing won't change.

The height:1em; vertical-align:text-bottom; declarations should not affect the interline spacing.

(The complete article is at https://www.willmaster.com/blog/development/embedding-images-within-lines-of-text.php)

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2026 Will Bontrager Software LLC