Password Hashing Overview In the world of web development and password storage, an ongoing debate lingers on, and probably will forever. The currently accepted “best practice” for hashing passwords is called Argon2 (wikipedia link to argon2). To give a brief overview of what it is, it takes any string (like...
php
This short block of PHP code takes a SQL script and removes the “dash-dash” and “/**/” comments from it. Of course, many languages, including PHP itself, use the “/**/” comment style so this could apply to PHP scripts, as well. The line that removes the dash-dash style comments could easily...
Finding a quick PHP function for date difference was painful. Now that I found it, here’s the quick easy way. This site was a great help: http://www.phpf1.com/tutorial/php-date-difference.html
Finding a quick PHP function for date difference was painful. Now that I found it, here’s the quick easy way. This site was a great help: http://www.phpf1.com/tutorial/php-date-difference.html
This short block of PHP code takes a SQL script and removes the “dash-dash” and “/**/” comments from it. Of course, many languages, including PHP itself, use the “/**/” comment style so this could apply to PHP scripts, as well.
Ideally, when setting up a data-driven PHP site, you should have your configuration and database connection code separate from your code that generates content. What I want to display is a simple way to keep things separate and simple to work with. I use a config/index/data file structure. There are...
Occasionally, you discover something that you have been doing wrong for a long time. Sometimes it wasn’t something outright wrong but was just stupid. That is what happened to me. When using an HTML checkbox, it “POSTS” to the form submit page with the value of “on”. I have always...
Goal: Reduce long string to specified length for end-user preview. Reveal entire string when clicked. Go back to preview when clicked again. Check out the php and jQuery code: https://gitea.rnsworth.com/ben/PublicPosts/src/commit/b4f180878df7edc1b7ab71918d566736d619c87b/PHP%20and%20jQuery%20-%20Reduce%20Long%20String%20to%20Preview%20Length%20and%20Reveal%20Full%20Text%20OnClick.md YHTSZWNS7R6V
A ternary operator is a quick shortcut to bypass the multi-line if-else statement. It is sufficient when simple setting a value of a variable based on a condition. It looks like this: That is saying “if $variable equals 10 then set $x equal to true, otherwise set $x equal to...
php.net – where I posted this Overview This is something that I used to use on this site before I went to WordPress. If you checked “view source” and looked at the meta keywords, you would notice a comma separated string. When programming, you may want to take a comma...