Cache web pages easily with PHP
If you want to serve pages quickly and without using a lot of resources from the webserver to your users you need to code efficiently. One of the ways to do it is to use cache for somewhat static pages.
If you want to serve pages quickly and without using a lot of resources from the webserver to your users you need to code efficiently. One of the ways to do it is to use cache for somewhat static pages.
Sometimes, we need to implement an external HTML code or specify HTML by design inside a WordPress page.
When we use the text editor of WordPress we have the option to do just that, but if we look closely on the HTML that is generated after the specific page is rendered, we can see some alteration to the code. Those alterations may cause a lot of problems if you build your design (CSS) by it. Usually, it comes to Ps that are added, page breaks or other unnecessary elements. Read more of a function tells WordPress to skip this parsing of the HTML and leave it intact.
Even though Base64 encoding is not an encryption, sometimes it can be useful to pass data or parameters in a single string.
Recently I build a PHP script for dynamically downloading files, and I came across the need to provide the right Mime-Type for each file I set to download. I wrote a function in PHP that gets file extension (with or without the dot prefix) and returns the correct Mime-Type.
First of all, what is “Cookie Hijacking”?
By Wikipedia, it’s an “exploitation of a valid computer session to gain unauthorized access to information or services in a computer system. In particular, it is used to refer to the theft of a magic cookie used to authenticate a user to a remote server”.
Which basically means, gaining access to an information system or a website without logging in, as the user that the cookie (or session) belongs to him.
If you can find the list of page templates in the page editor on WordPress try this quick fix that will probably help.
A quick and easy way to prevent specific resources to be cached by sending the correct headers in .htaccess file.
Sending an email is probably the most convenient way of communicating data or informing us of an event from our ESP8266. It’s cross-platform, works on every device and very reliable. It can alert us when one of the sensors detected something (PIR sensor for movement, MQ2 for air quality or any other environmental sensor).
There are a few ways to get that done, and in this post, I’ll show you my preferable way.
Handling resources, redirects and other operations is very easy and useful using the .htaccess file of Apache web server.
Sometimes, we want to block or redirect traffic based on its network IP address.
But what to do when %{REMOTE_ADDR} returns the wrong address? (more…)
WordPress is a very popular platform, and I have had many WordPress installations over the years (even this site is based on it).
Being that popular has made this platform a target for many hackers. And even though it keeps updating and upgrading, over the years I found myself a victim of hostile takeovers.
In this article, I’ll discuss and demonstrate how to add two-step authentication as an extra level of security to your site or blog.