Archief van

Values and multidimensional arrays

Geschreven door Erwin A.W. Maas

Full-stack webdev in a nutshell:

When you're trying to get some values from an array that you've been building for hours and you feel you're almost there:

foreach ($all as $allkey => $allvalue) {
    for ($getthefuckingvalues = 0;$getthefuckingvalues < 3;$getthefuckingvalues++) {
        echo $allkey . ": " . $allvalue . "<br>";

Didn't work: Warning: Array to string conversion in...😡

Stamboom Maas op Mijn Genea

Geschreven door Erwin A.W. Maas

Uitleg en tips versie Mijn Genea

(Terug) naar de stamboom beginpagina

Deze webpagina geeft informatie en verdere uitleg over de stamboom die te vinden is op Mijn Genea.

Om ook levende personen te zien moet je daar eerst een account aanmaken, laat het me weten als je dat gedaan hebt.

❗ Klik hieronder op "...meer" om de uitleg te bekijken.


Away with external scripts and a strong CSP

Geschreven door Erwin A.W. Maas

Results security scan

I have been busy with a strong Content Security Policy the last couple of months and experienced all kinds of issues with 3rd-party scripts like analytics-tools and a consent-manager script that I needed because of these analytics tools.

To keep everything running fine I had to add several things to the CSP that I didn't like, for example 'unsafe-inline' and 'unsafe-eval'.
Next to that one item of the cookie-consent-script just did not load and there was nothing to do about it before the scriptprovider themselves make changes to it so that I can Hash or Nonce it.

So what did I do?


Get the real last 24 hours with PHP

Geschreven door Erwin A.W. Maas

Getting the last 24 hours

Looking around on the web about this, you mostly see the wrong solutions, so:
If you want to query a database for the last 24 hours in a MySQL-query like:

SELECT * FROM mytable WHERE date BETWEEN '$lastday' AND '$date'

Then using:

$date = date('Y-m-d'); $lastday = date('Y-m-d',strtotime("-1 day"));

will give you today + yesterday all day.

Instead you need to do:

$lastday = date('Y-m-d',strtotime("-1 day + 24 hours"));

So: if you're not sure, check your code!

From arrays to MySQLi

Geschreven door Erwin A.W. Maas

So: no arrays...

One of my hobbies is genealogy.
My familytree consists of around 12.000 people

I like to host my familytree myself, but I have tried every single application and there's not one that suits me.
So I decided to start building one myself.

On localhost I have been working for about two weeks on an array-based (without a database) application and I got very far, but it came to an abrupt end when the webserver ran out of memory on the most important functionality.

So: that was that and on to a MySQLi-based fully self-build familytree!

The web is going nuts

Geschreven door Erwin A.W. Maas

Back after almost 24hrs.

Well: that was an adventure...

Yesterday morning around 09.00 I couldn't see my webpage anymore and thought it was down. But I also couldn't reach control-panel, no FTP, no Webdisk, nothing.
After 24hrs. I received a message that our IP-number was blocked by the server, blocked by your own domain

Well: Ip whitelisted, problem solved.
That's a bit different than being blocked by Facebook over and over and never receiving an answer to any question... 🙄 🤮 🖕