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
<html> | |
<head> | |
<title>Cuenta Regresiva con FlipDown.JS</title> | |
<link href="assets/css/flipdown.css?v=<?php echo rand(); ?>" rel="stylesheet"> | |
<style> | |
.example { | |
font-family: 'Roboto', sans-serif; | |
width: 550px; | |
height: 378px; |
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
// en $conn tendríamos la conexión a la base de datos con MySQLi | |
$conn = mysqli_connect("localhost", "usuario_db", "password_db", "basedatos"); $id_usuario = $_POST["id_usuario"]; | |
$query = mysqli_prepare("SELECT * FROM usuarios WHERE id_usuario = ?"); mysqli_stmt_bind_param($query, "i", $id_usuario); | |
mysqli_stmt_execute($query); |
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
// en $mysqli tendremos la conexión MySQLi | |
$mysqli = new mysqli("localhost", "usuario_db", "password_db", "basedatos"); $id_usuario = $_POST["id_usuario"]; | |
$query = $mysqli->prepare("SELECT * FROM usuarios WHERE id_usuario = ?"); | |
$query->bind_param("i", $id_usuario ); $query->execute(); |
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
$pdo = new PDO('mysql:host=localhost;dbname=basedatos', "usuario_db", "password_db"); $id_usuario = $_POST["id_usuario"]; | |
$query = $pdo->prepare("UPDATE usuarios SET id_usuario = :id_usuario WHERE id_usuario = :usuario_id"); | |
$query=$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); | |
$query->bindParam(":id_usuario", $id_usuario, PDO::PARAM_INT); | |
$query->bindParam(":usuario_id", $id_usuario, PDO::PARAM_INT); | |
$query->execute(); |
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
// la variable $pdo contendrá el objeto con la conexión PDO | |
$pdo = new PDO('mysql:host=localhost;dbname=basedatos', "usuario_db", "password_db"); $id_usuario = $_POST["id_usuario"]; | |
$query = $pdo->prepare("SELECT * FROM usuarios WHERE id = :id_usuario"); | |
$query=$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); | |
$query->bindParam(":id_usuario", $id_usuario, PDO::PARAM_INT); | |
$query->execute(); |
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
$id_usuario = $_POST["id_usuario"]; | |
mysql_query("SELECT * FROM usuarios WHERE id_usuario = $id_usuario"); | |
Eso es un ejemplo de una vulnerabilidad grave en la seguridad de una aplicación (web o no) | |
porque si el usuario introdujese un valor como: | |
DROP TABLE usuarios; | |
nos encontraríamos con que la sentencia ejecutada sería: | |
SELECT * FROM usuarios WHERE id = 1; |
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
<IfModule mod_ssl.c> | |
<VirtualHost _default_:443> | |
ServerAdmin webmaster@jaimefranko.com | |
ServerName jaimefranko.com | |
ServerAlias www.jaimefranko.com | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@jaimefranko.com | |
ServerName jaimefranko.com | |
ServerAlias www.jaimefranko.com | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/> |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@jaimefranko.com | |
ServerName jaimefranko.com | |
ServerAlias www.jaimefranko | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/> |
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 fechaES ($fecha) { | |
$fecha = substr($fecha, 0, 10); | |
$numeroDia = date('d', strtotime($fecha)); | |
$dia = date('l', strtotime($fecha)); | |
$mes = date('F', strtotime($fecha)); | |
$anio = date('Y', strtotime($fecha)); | |
$dias_ES = array("Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"); | |
$dias_EN = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); | |
$nombredia = str_replace($dias_EN, $dias_ES, $dia); |
NewerOlder