background preloader

Php

Facebook Twitter

To the Core of the Script. To allow easier integration with other scripts and make things more modular the core script is an object with very simple interface. This is the class definition and the constructor of the object. OK it's not perfectly modular but a date isn't much of a problem. It is invoked like: $date = gmdate("'Y-m-d'"); $db = db_connect(); $user = new User($db); Now to clear the code purpose, we check if the user is logged in. If he/she is then we check the session (remember it is a secure script), if not and a cookie named just for example mtwebLogin is checked - this is to let remembered visitors be recognized.

Logging in Users To allow users to login you should build a web form, after validation of the form you can check if the user credentials are right with $user->_checkLogin('username', 'password', remember). Function _checkLogin($username, $password, $remember) { $username = $this->db->quote($username); $password = $this->db->quote(md5($password)); $sql = "SELECT * FROM member WHERE " .

Www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf. PHP Error | error reporting for PHP. 37 Tested PHP, Perl, and JavaScript Regular Expressions. InShare22 A regular expression, also called regex or regexp for short, is simply a piece of code that matches a pattern. Mastering regular expressions can be a difficult chore, and if you don't need them all of the time, the syntax is tricky enough to make the task frustrating or slow as you will constantly need to use a reference sheet. In order to save you time, I've compiled a list of PHP, Perl, and JavaScript regular expressions for common use cases that have been tested and are ready to go. This isn't a regular expression tutorial or even a reference; you can think of it more as a cheatsheet for when you just need the regex but don't want to put a lot of time into relearning regular expressions.

If you're looking for regex tutorials or regex resources, you can find them at the end of the page as well as some additional regex resources. Perl and PHP Regular Expressions All Major Credit Cards Alpha-Numeric Characters Test for alpha-numeric characters with this regexp. Alphabetic Characters. Automatic Face Detection in Photos with PHP. I have always wondered how to detect faces automatically with php script. I have seen in many photo sharing and social network sites automatically detect a face and tag a name after being uploaded. In this article, i will explain how possible this task can be achieved with simplicity with OpenCV and PHP Facedetect extension. Both are free to download and opensource.

Goal To auto detect faces in a photo and draw pink box around the faces with a php script running a linux centos server. Please note that face detection and face recognition are two different things. To recognize a face you have to first detect a face and then do the required processing. Requirements - Linux server running Centos with SSH access - PHP/Apache - GD Library - OpenCV [Download] - PHP Facedetect extension [Download] PHP facedetect extension is very simple. Installation We install opencv and then we compile the php facedetect extension with php. How to Install OpenCV yum install opencv How to test run OpenCV . run . then Enjoy!