¿Qué es MVC? Desarrollo web

http://www.desarrolloweb.com/articulos/que-es-mvc.html

Anuncios

Link de recursos Web

http://www.webresourcesdepot.com/

Plantilla de aplicacion wEb

https://github.com/pilu/web-app-theme

Solucion Para Codeignider multiple query, store procedure con mysql

Fuente: http://codeigniter.com/forums/viewthread/179001/

Error Number: 2014
Commands out of sync; you can’t run this command no
w

I have made small change in database/drivers/mysqli/mysqli_result.php function free_result()
to as below.
function free_result()
{

if (is_object($this->result_id)) {
mysqli_free_result($this->result_id);
/*
Edited by Safarath sk in order to free the mysqli multiple set results.
Date: 23/01/2011
*/
while ($this->conn_id->next_result()) {
/*free each result.*/
$result = $this->conn_id->use_result();
if ($result instanceof mysqli_result) {
$result->free();
}
}
$this->result_id = false;
}
}

Seguridad en aplicaciones web

http://plan.aragob.es/circa.nsf/d0dfb4ba18af2cb8c12571650041e5c5/9c40951c13713f45c1257206003be3a6/$FILE/SEGU_ManualUsuario2_0.pdf

Instalar libreria cifrado php en centos

yum install php-mcrypt

yum install php-mhash

fuente:

http://www.notesbit.com/index.php/web-mysql/web-scripts/how-to-install-mcrypt-in-linux-cent-os-and-recompile-php/

Generar archivo para descargar

$nombre = 'precios.txt'; // Nombre del archivo
$contenido = 'Texto del archivo'; // Contenido del archivo
header( "Content-Type: application/octet-stream");
header( "Content-Disposition: attachment; filename=".$nombre."");
print($contenido);

cifrado con php

http://es.w3support.net/index.php?db=so&id=805686

<?php
function Encrypt($string, $key)
{
if (extension_loaded(‘mcrypt’) === true)
{
return base64_encode(mcrypt_encrypt(MCRYPT_BLOWFISH, substr($key, 0, mcrypt_get_key_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB)), trim($string), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB), MCRYPT_RAND)));
}
return false;
}
function Decrypt($string, $key)
{
if (extension_loaded(‘mcrypt’) === true)
{
return trim(mcrypt_decrypt(MCRYPT_BLOWFISH, substr($key, 0, mcrypt_get_key_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB)), base64_decode($string), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB), MCRYPT_RAND)));
}
return false;
}

function Encrypt_File($source, $destination, $key)
{
if (extension_loaded(‘mcrypt’) === true)
{
if (is_file($source) === true)
{
$source = file_get_contents($source);
if (file_put_contents($destination, Encrypt($source, $key), LOCK_EX) !== false)
{
return true;
}
}
}
return false;
}

function Decrypt_File($source, $destination, $key)
{
if (extension_loaded(‘mcrypt’) === true)
{
if (is_file($source) === true)
{
$source = file_get_contents($source);
if (file_put_contents($destination, Decrypt($source, $key), LOCK_EX) !== false)
{
return true;
}
}
}
return false;
}

if(Encrypt_File(‘Desert.jpg’, ‘Desert-s.jpg’, ‘123456’)){
echo ‘ encriptado el archivo’;
}
if(Decrypt_File(‘Desert-s.jpg’, ‘Desert-d.jpg’, ‘123456’)){
echo ‘ desencriptado ‘;
}
?>

 

 

<?php
$myKey = pack('H*', '1234567890ABCDEF0123456789ABCDEF');
$myIV  = pack('H*', '89ABCDEF0123456789ABCDEF01234567');
$myMsg = "Mdn6jGTwRPMOKTYTTdDKGm9KScz26LIz96KVOGAeMw3hpwByPfa07PDRHxRW4TIh5dmu5LlhKpTQChi=";

echo 'Key: ' . bin2hex($myKey) . '<br />';
echo 'IV: ' . bin2hex($myIV) . '<br />';

echo 'Decrypted: ' . getDecrypt(
$myMsg,
$myKey,
$myIV
);

function getEncrypt($sStr, $sKey, $sIV) {
return base64_encode(
mcrypt_encrypt(
MCRYPT_RIJNDAEL_128,
$sKey,
$sStr,
MCRYPT_MODE_CFB,
$sIV
)
);
}

function getDecrypt($sStr, $sKey, $sIV) {
return mcrypt_decrypt(
MCRYPT_RIJNDAEL_128,
$sKey,
base64_decode($sStr),
MCRYPT_MODE_CFB,
$sIV
);
}

?>

 

http://forums.devshed.com/php-development-5/using-mcrypt-to-encrypt-decrypt-aes-in-php-557280.html