Sometimes, while working with Cookies in PHP you may want to make a cookie never expire (e.g. in a rating script where you set a cookie on user’s computers, although it’s not wise to use cookies as the only protection against multiple ratings by the same user, because cookies are easily deleted). Continue reading “How to Set a Cookie to Never Expire”
Month: August 2011
PHP Login Script Example
This PHP login script example is a very simple login system which you can use as a base for your future projects. You should note that it needs to be secured before using on a live system. Some things to do before using it: md5 the password and compare against a md5 encrypted version of the submitted form password, set cookie which can be then checked at the admin.php page if login was successful. Continue reading “PHP Login Script Example”
Simple PHP HTTP Authentication
Sometimes you may want to hide the contents of a page (e.g. admin page) in a very simple manner. The best and simplest method is to use the PHP’s built in HTTP authentication. It’s both secure and compatible with 99% of your visitor’s browsers. Continue reading “Simple PHP HTTP Authentication”