This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function ssha_password($password){ | |
| $salt = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',4)),0,4); | |
| return '{SSHA}' . base64_encode(sha1( $password.$salt, TRUE ). $salt); | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name localhost; | |
| root /home/website/web; | |
| rewrite ^/app\.php/?(.*)$ /$1 permanent; | |
| try_files $uri @rewriteapp; | |
| location @rewriteapp { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Regions | |
| CREATE TABLE regions( | |
| region_id SERIAL PRIMARY KEY, | |
| name character varying(255) | |
| ); | |
| -- Cities | |
| CREATE TABLE cities ( | |
| city_id SERIAL PRIMARY KEY, | |
| region_id integer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function create_zip($path, $save_as) | |
| { | |
| if (!extension_loaded('zip')) | |
| throw new ErrorException('Extension ZIP has not been compiled or loaded in php.'); | |
| else if(!file_exists($path)) | |
| throw new ErrorException('The file/path you want to zip doesn\'t exist!'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function create_zip($path, $save_as) | |
| { | |
| if (!extension_loaded('zip')) | |
| throw new ErrorException('Extension ZIP has not been compiled or loaded in php.'); | |
| else if(!file_exists($path)) | |
| throw new ErrorException('The file/path you want to zip doesn\'t exist!'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This function replaces all of the links in $text with with html links. | |
| * | |
| * @param string $text | |
| * @param string $target ("_blank", "_self", "_parent", "_top", framename) | |
| * | |
| * @return string | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Search through an array for a matching key. | |
| * | |
| * Examples: | |
| * <code> | |
| * $array = array( | |
| * "database.name" => "my_db_name", | |
| * "database.host" => "myhost.com", |
NewerOlder