<?php if (!isset($_SERVER[‘PHP_AUTH_USER’])) { header(“WWW-Authenticate: Basic realm=\”Private Area\””); header(“HTTP/1.0 401 Unauthorized”); print “Sorry – you need valid credentials to be granted access!\n”; exit; } else { if (($_SERVER[‘PHP_AUTH_USER’] == ‘paul’) && ($_SERVER[‘PHP_AUTH_PW’] == ‘hudson’)) { print “Welcome to the private area!”;
Tag Archives: PHP
Practical PHP Programming
Practical PHP Programming Welcome to the new home of Practical PHP Programming – now updated for PHP 5.2. This is the definitive source for the book from now on, and you’ll be pleased to know the entire book is hosted on a super-fast server so you should never have access troubles again.
PHP Shorthand If / Else Examples
Basic True / False Declaration $is_admin = ($user[‘permissions’] == ‘admin’ ? true : false);
php mysql backup
Welcome to phpMyBackupPro Here on the offcial homepage you will find all informations about phpMyBackupPro (pMBP). phpMyBackup Pro is a very easy to use, free, web-based MySQL backup application, licensed under the GNU GPL. You can create scheduled backups, manage and restore them, download or email them and a lot more!
PHP Validation
Demo form and explanation Probably the best way to understand how the script works is to see an example. Take a look at the demonstration page. The PHP and validation code in that page is this: