This file contains 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 | |
$dbhost = 'hostname'; | |
$dbname = 'dbname'; | |
$dbuser = 'dbuser'; | |
$dbpass = 'dbpassword'; | |
$dsn = 'mysql:dbname='.$dbname.';host='.$dbhost; | |
try { | |
$dbh = new PDO($dsn, $dbuser, $dbpass); | |
} catch (PDOException $e) { |
This file contains 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 | |
$password = substr( md5(microtime()), 1, 8); |
This file contains 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 autoVer($url) | |
{ | |
$path = pathinfo($url); | |
$ver = '?v='.filemtime($_SERVER['DOCUMENT_ROOT'].$url); | |
return $path['dirname'].'/'.$path['basename'].$ver; | |
} |
This file contains 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 | |
// abrimos la sesión cURL | |
$ch = curl_init(); | |
// definimos la URL a la que hacemos la petición | |
curl_setopt($ch, CURLOPT_URL,"http://www.aeurus.cl/api.php"); | |
// indicamos el tipo de petición: POST | |
curl_setopt($ch, CURLOPT_POST, TRUE); | |
// definimos cada uno de los parámetros | |
curl_setopt($ch, CURLOPT_POSTFIELDS, "valor1=value1&valor2=value2&valor3=value3"); |
NewerOlder