1 - Instalando via cURL: curl -sS https://getcomposer.org/installer | php Instalando via PHP: php -r “readfile(‘https://getcomposer.org/installer’);” | php *dentro do diretorio do projeto 2 - Ter o composer.json
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 | |
$address = 'avenida+gustavo+paiva,maceio,alagoas,brasil'; | |
$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$address.'&sensor=false'); | |
$output= json_decode($geocode); |
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
SELECT MIN(ID) as id, label as label_alt | |
FROM table | |
GROUP BY label | |
ORDER BY MIN(ID) |
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
SELECT * FROM table where id IN('74', '75', '76', '77', '78', '79', '80', '81') |
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
<!DOCTYPE html> | |
<html lang="pt"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> | |
<label for="valor">Qual o valor senhor?</label> | |
<input id="valor" type="text" name="valor"> |
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
Fatal error: Uncaught exception 'Exception' with message 'Falha ao alterar servidores DNS código 2308: mensagem 'Violação na política de gerência | |
Fatal error: Uncaught exception 'Exception' with message 'Falha ao alterar servidores DNS código 2308: mensagem 'Violação na política de gerência de dados' motivo 'Domínio desconhecido'' in /home/super/public_html/home/modules/registrars/registrobr/RegistroEPP/RegistroEPPDomain.class.php:108 Stack trace: #0 /home/super/public_html/home/modules/registrars/registrobr/registrobr.php(324): RegistroEPPDomain->updateNameServers(Array, Array) #1 /home/super/public_html/home/includes/classes/WHMCS/Module.php(0): registrobr_SaveNameservers(Array) #2 /home/super/public_html/home/includes/classes/WHMCS/Module/Registrar.php(0): WHMCS_Module->call() #3 /home/super/public_html/home/includes/classes/WHMCS/Domains.php(0): WHMCS_Module_Registrar->call() #4 /home/super/public_html/home/clientarea.php(0): WHMCS_Domains->moduleCall() #5 {main} Next exception 'Exception' with message |
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
function buscarCep (cep) { | |
cep = cep.replace(/\D/g, ""); | |
var end = ''; | |
var path = path_site(); | |
// console.log("p" + path); | |
// -- a busca | |
$.getJSON( path + '/cep.php?cep='+cep, | |
function (dados){ |
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
// --Retorna ano para select | |
function ano_select(){ | |
//The 60 value here is the amount of years to go back | |
$year = date("Y") - 100; | |
//The 60 value here is the amount of years to go forward | |
//because i went back 50 years, i'm going forward 50 years so the dropdown will always have the current year. | |
for ($i = 0; $i <= 82; ++$i) | |
{ | |
$year2[] = $year; |
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 | |
session_start(); | |
//The second parameter on print_r returns the result to a variable rather than displaying it | |
$RequestSignature = md5($_SERVER['REQUEST_URI'].$_SERVER['QUERY_STRING'].print_r($_POST, true)); | |
if ($_SESSION['LastRequest'] == $RequestSignature) | |
{ | |
echo 'This is a refresh.'; | |
} | |
else |
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 # -*- coding: utf-8 -*- | |
// function remove_accents() | |
/** | |
* Unaccent the input string string. An example string like `ÀØėÿᾜὨζὅБю` | |
* will be translated to `AOeyIOzoBY`. More complete than : | |
* strtr( (string)$str, | |
* "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", | |
* "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn" ); | |
* |