Location: PHPKode > projects > Classifieds > classifieds/classes/CommonFunctions.php
<?php

	

class CommonFunctions {

	

	public static function checkEmailExists($email) {

		$result = mysql_query("SELECT * FROM Users WHERE email='$email' LIMIT 1");

        if (mysql_num_rows($result) == 1) return true; 

	}

    

    public static function hashPass($password) {

        $password = hash('sha256', $password);

        return $password;

    }

    

    public static function getID($email) {

        $result = mysql_query("SELECT * FROM Users WHERE email='$email' LIMIT 1");

        $resultObj = mysql_fetch_object($result);

        $userID = $resultObj->id;

        return $userID;

    }

            

}        

    

?>
Return current item: Classifieds