Type casting with PHP

PHP is a loosely typed language and assigns types to variables depending what is assigned to it. Variables coming from get/post and cookies etc are generally cast as strings rather than other types and there are often other times when you need to specifically cast a type in PHP as e.g. an integer. This post looks at how to type cast in PHP and some of the results than can come about from type casting.

Categories PHP

Using the HTTP_REFERER variable with PHP

When a web browser moves from one website to another and between pages of a website, it can optionally pass the URL it came from. This is called the HTTP_REFERER, and this post looks at how to use this variable with PHP.

Categories PHP

Get an image size with PHP

PHP has a function called getimagesize() for getting the width and height from an image. I’m always forgetting the name of the getimagesize() function so I decided to write a post about it and showing some examples and that way maybe I’ll remember in the future…

Categories PHP

Create RSA and DSA Keys for SSH

Private and public RSA keys can be generated on Unix based systems (such as Linux and FreeBSD) to provide greater security when logging into a server using SSH. The ssh-keygen command allows you to generate, manage and convert these authentication keys.