Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - дٳŦ٭

#8
PHP / Ponerle nombre al framework
3 Mayo 2010, 19:59 PM
Hola,

Verán, he terminado de desarrollar mi framwork/CMS pero aún no he definido el nombre, vengo a pedirles su opinión para ver qué nombre le podemos poner. Recodandoles que es 100% opensource. Les pongo las características generales:

Framework structure
Explanation
The Vendor Screening Interface site use a new Framework developed in PHP5 with methodology MVC (model, view and controller), is a best practice in the web 2.0. Take advantage of all the options that Apache provides for proper SEO (Search engine optimization).
Is a simple content management Framework which we have used to make lots and lots of great websites. Unlike typical CMS systems such as Joomla or Drupal, this Framework is not a pre-packaged install-and-go system, but rather a series of components tied together by a programming Framework. The main benefits of using this Framework are that the administration interface is very easy to use and since this Framework is a series of components, it's very flexible and expandable. This Framework is in use in over 50 sites worldwide.

Features

Role based user administration
Users are assigned to groups and each group has a different set of permissions. Permissions are based on the different modules that are set up which means that if you add a new module it automatically appears in the permission list. This is nothing new, but works exactly as you expect.

3 Level content administration
Following the 3-click rule of usability we generally limit the content to 3 levels. While the design permits it you can add and remove sections, subsections and subsubsections dynamically. Each one can be edited using one of two WYSIWYG editors that we use (FCK editor and Spaw) the order in which they appear in the navigation can be changed and you can change their status in order to deactivate without removing them.

Internal search engine
By using the MySQL Fulltext function we generally integrate a internal search engine in each site.

Modern web standards
We try to avoid talking about Web 2.0, but our system does include several features which are generally described as web 2.0. Friendly URLs, Tag Clouds and Ajax libraries are all included in this framework. You'll need to make your own oversized and shiny buttons, but the rest is taken care of. We could talk forever about features, but the most important is that the system is easy to use and flexible enough for you to add new features as needed.

¿Cómo ven?, pensé en ponerle AMC xDD pero prefiero algo más formal pero sin llegar a un tipo "Drupal" o "Joomla", prefiero algo más en forma.

Les agradezco mucho,

-Alf
#12
Hola,

Tengo el siguiente problema..

Tengo 7 bases de datos, con datos del 1 al 1200, 1200 al 2300 y así.. son consecutivos pero están partidos  :xD bueno, me pasaron una base de datos concentrada con todas las filas que supuestamente están (o deberían estar en las mini bases).

La primer consulta es cómo puedo seleccionar las filas donde un entero sea diferente, digamos que tengo un numero en un campo y necesito sacar los número únicos de la base de datos concentrada.

La segunda es como puedo obtener las filas que NO estén en las mini bases pero que estén en la base de datos concentrada (ya únicas).

Es en Mysql.

Gracias de antemano,

Alfonso.
#14
Hola,

Aprovechando para casi inaugurar el foro  ;D vengo con una duda que tengo desde que compré mi c905 de Sony Ericsson.

Bueno.. pues el teléfono tiene un receptor GPS, el cual me indica mi compañia telefónica es a-GPS (Asistido), lo que requiere una conexión a internet para bajarme los mapas y hacer funcionar el receptor. La pregunta es si hay alguna forma de echar andar el receptor sin asistencia, ya que tener internet me sale bastante caro.. Ya he probado el TrekBuddy pero no consigo que se active el receptor.

Muchas gracias,

Alfonso.
#15
PHP / MOVIDO: ¿Es mi código seguro?
13 Octubre 2009, 19:00 PM
#16
PHP / MOVIDO: diseño web.
18 Septiembre 2009, 02:10 AM
#17
PHP / MOVIDO: forzar ie
16 Agosto 2009, 20:51 PM
#19
PHP / Ordenar registros
13 Julio 2009, 19:41 PM
Hola PHPecheros,

Tengo una duda, que más que duda siento es error de lógica:

Tengo una tabla "banner":


mysql> describe banner;
+---------------+------------------+------+-----+---------+----------------+
| Field         | Type             | Null | Key | Default | Extra          |
+---------------+------------------+------+-----+---------+----------------+
| id_banner     | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| nombre        | varchar(45)      | YES  |     | NULL    |                |
| archivo       | varchar(200)     | YES  |     | NULL    |                |
| thumbnail     | varchar(200)     | YES  |     | NULL    |                |
| ventana_nueva | tinyint(1)       | YES  |     | NULL    |                |
| url           | varchar(255)     | YES  |     | NULL    |                |
| activo        | tinyint(1)       | YES  |     | 1       |                |
| borrado       | tinyint(1)       | YES  |     | 0       |                |
| altura        | int(11)          | NO   |     |         |                |
| anchura       | int(11)          | NO   |     |         |                |
| defront       | tinyint(1)       | NO   |     |         |                |
| slot          | int(10) unsigned | NO   | UNI |         |                |
+---------------+------------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)


En donde verán un campo llamado slot(int) que sirve para almacenar de 1 a N (sin que se repitan), esto se hace para ordenar de forma visual mis registros. La duda radica es cómo hacer un manager para controlar el orden.

Lo que hice fue hacer una lista con un par de flechas por cada registro, si es el slot==1 no pongo la flecha hacia "arriba", y de igual forma si es el último slot no pongo la que apunta hacia abajo.

La funcionalidad de "subir" ya quedó OK, sin embargo la bajada nop..  :-\

Los parámetros que mando por cada registro en el link son:

order=down&id_banner=1&slot=1&idnextslot=2

Donde id_banner es el ID del registro, el slot es el número de slot que tiene y el idnextslot es el slot siguiente.

En mis querys tengo lo siguiente:

Código (php) [Seleccionar]

//--------------------------------------------------------------+
// Case Down |
//--------------------------------------------------------------+
if($var['order']=="down"){
//--------------------------------------------------------------+
// First get the next Number ID slot and ID_banner |
//--------------------------------------------------------------+
$DBQuery->attrib['query'] = "SELECT id_banner, slot FROM `banner` WHERE `id_banner` ='".$var['idnextslot']."'";
//echo $DBQuery->attrib['query']."<br>";
$getNextSlot = $DBQuery->RunQuery();

//--------------------------------------------------------------+
// Update the original entry with the new id_slot |
//--------------------------------------------------------------+
$DBQuery->attrib['query'] = "UPDATE `banner` SET `slot` = '".$var['idnextslot']."' WHERE `id_banner` ='".$var['id_banner']."'";
//echo $DBQuery->attrib['query']."<br>";
$downSlot=$DBQuery->RunQuery();

//--------------------------------------------------------------+
// Update the entry target with the old slot |
//--------------------------------------------------------------+
$DBQuery->attrib['query'] = "UPDATE `banner` SET `slot` = '".$var['slot']."' WHERE `id_banner` ='".$getNextSlot[0]['id_banner']."'";
//echo $DBQuery->attrib['query']."<br>";
$downSlot=$DBQuery->RunQuery();

}


Simplemente no funciona.. me actualiza los registros mal  :xD  :-\, me pone slot's elevados y a veces menores. A ver si me podeis echar un cable.. gracias  :)
#20
PHP / Parser htmlspecialchars()
12 Junio 2009, 03:01 AM
Buenas...

Estoy haciendo un parser (por decirlo así) para proteger nuestras aplicaciones, aquí lo teneis:

Código (php) [Seleccionar]

//-------------------------------------------------------------------------------------------------------------------------+
// Here emerge the two types of globals vars, copy all incoming POST and GET variables to an associative array called $var |
//-------------------------------------------------------------------------------------------------------------------------+
if(!isset($var) || !is_array($var)) {
$var = array();
$var = array_merge($_POST, $_GET); // GET overwrites POST
}

// With this function, we are clear the html chars to entity ascii
function clear_chars($var){
if(!is_array($var)){
return htmlspecialchars($var);
}
else{
$new_var = array();
foreach ($var as $j => $p){
$new_var[htmlspecialchars($j)]=clear_chars($p);
return $new_var;
}
}
}
if($_POST) $_POST=clear_chars($_POST);
if($_GET) $_GET=clear_chars($_GET);
if($_REQUEST) $_REQUEST=clear_chars($_REQUEST);
if($_SERVER) $_SERVER=clear_chars($_SERVER);
if($_COOKIE) $_COOKIE=clear_chars($_COOKIE);


El problema va porque cuando lo parseo, se pierden los todos los arrays, excepto el primero, alguna idea?

Thanks.
#21
PHP / NST Web Based Anti-DoS v0.1
6 Junio 2009, 07:15 AM
Código (php) [Seleccionar]
<?
/*
/************************************************************
/                                                                                                       
/           NST Anti Denial of Service Script  v 0.1                                           
/                                                                                                       
/                                                                                                       
/                                                                                                       
/             Author: Link   < link07@gmail.com >                             
/                                                                                                       
/              ..::[N]eo [S]ecurity [T]eam::..                                         
/                                                                                                         
/              http://www.neosecurityteam.net   
/
/                   Date:  October - 2006               
/                                                                                                         
/                                                                                                         
/*************************************************************


     This script will prevent Dos and DDos attacks using request flood
     of http packets, that causes your server to excecute to much connections
     with the database and execute tha php interpreter a lot of times in a few
     seconds, all you have to do to install this is include it in a script that
     all your scripts use , an script for the database connection for example
     and create three empty txt files on the same folder with write and read
     permissions: log.txt , bans.txt , counter.txt
     This script will ban users using the .htaccess file, so dont forget to put
     this is script on the same folder as the .htaccess file as well
     It is very configurable just modify the parameters indicated below , to
     asign how sctrict the script will act. 

*/

$data = "";

$ban = "";

$visits = 1;

$error = 0;

$ahora = date("Y-n-j H:i:s");

$safemode = 0;

$new = "";

$flooder =0;

$registered = 0;

$wwwdir = "/home/neosecur/public_html/";

$ahora = date("Y-n-j H:i:s");

if(!$file = @fopen($wwwdir."log.txt","r"))

$error = 1;

while (!@feof($file))

{

$data .= @fgets($file);

}

$visitor = explode("\n",$data);

$i=0;

while($visitor[$i])

{

$iptime = explode("@",$visitor[$i]);

if ($_SERVER['REMOTE_ADDR'] == $iptime[0])

{



$tiempo = strtotime($ahora) - $iptime[1];

if ($tiempo <= 1)  // this line controls the acces of an ip, only one request during the number of seconds you replace here

{

$safemode = 1;


$flooder = 1;

}


$iptime[1]=strtotime($ahora);





$registered = 1;

}

$new .=$iptime[0]."@".$iptime[1]."\n";

$i++;

}


if (!$registered)

$new.=$_SERVER['REMOTE_ADDR']."@".strtotime($ahora)."\n";



if (!@fclose($file))

$error = 1;



if(!$file = @fopen($wwwdir."log.txt","wt"))

$error = 1;



@fwrite($file,$new);

if (!@fclose($file))

$error = 1;



if (!$fcount = @fopen($wwwdir."counter.txt","rt"))

$error = 1;

$vst = @fgets($fcount);

$count = explode("@",$vst);

if (strtotime($ahora) == $count[1])

{

$visits = $count[0] + 1;

$count[0] = $visits;

}

else

{

$count[0] = 1;

$count[1] = strtotime($ahora);

}

if (!@fclose($fcount))

$error = 1;



$new = $count[0]."@".$count[1];



if (!$fcount = @fopen($wwwdir."counter.txt","wt"))

$error = 1;



@fwrite($fcount,$new);



if (!@fclose($fcount))

$error = 1;




$new = "";

$registered = 0;



if ($visits > 4) // this line controls visits during a second, it is used to prevent ddos attacks you can modify this depending on the capacity of your server

{

$safemode = 1;

if ($flooder)

{

if (!$fban = @fopen($wwwdir."bans.txt","rt")) $error = 1;

while (!@feof($fban))

{

$ban .= @fgets($fban);

}

$ips = explode ("\n",$ban);

$i=0;

while ($ips[$i])

{

if ($_SERVER['REMOTE_ADDR'] == $ips[$i])

$registered = 1;

$i++;

$new .=$ips[$i];

}

if (!@fclose($fban)) $error = 1;



if (!$registered)

{

if (!$fban = @fopen($wwwdir."bans.txt","wt")) $error = 1;

$new .=$_SERVER['REMOTE_ADDR']."\n";

@fwrite($fban,$new);

if (!@fclose($fban)) $error = 1;

}

else

{

if (!$fht = @fopen($wwwdir.".htaccess","rt"))

$error = 1;

$cont = "";
$cont2 = "";
$eob = 0;
while (!@feof($fht))

{

$a = @fgets($fht);

if ($eob)
$cont2.=$a;
else
{
if ($a == "</Limit>\r\n" or $a == "</Limit>" or $a == "</Limit>\n")
{
$eob = 1;
$cont2.=$a;
}
else
$cont.=$a;
}

}



if (!@fclose($fht))

$error = 1;

if (!$fht = @fopen($wwwdir.".htaccess","wt"))

$error = 1;


$cont .= "Deny from ".$_SERVER['REMOTE_ADDR']."\n";
$cont .= $cont2;

@fwrite($fht,$cont);

if (!@fclose($fht))

$error = 1;

}

}


}


if ($error)

{

echo "ocurrio un error inesperado por favor trata actualizando de nuevo o vuelve en un rato. Gracias por tu comprensión.";

exit(0);

}

if($safemode)

{

echo '<META HTTP-EQUIV="Refresh" CONTENT="2;URL=">';

exit(0);

}



// if no restrictions have been activated , the content of the web will be displayed normally
//echo "contenido";
?>
#23
pues hice un tema preguntando por que habian borrado el tema de mexico vs costarica y lo unico que obtuve fue que lo borraran tambien, alguien del "h. staff" podria hacerme la caridad de explicarlo?
#32
How to: Apache + SSL + cURL + eAccelerator + PHP5 + MySQL + OracleXE + Webmin + SSH + VNC + Webalizer + phpMyAdmin en Debian Etch

Debido a necesidades de un cliente le he tenido que instalar todo eso en un servidor dedicado. Si alguien lo hace recomiendo que primero lo prueben en una virtual.  ;)


Instalar Debian con:
Sistema de escritorio
Sistema base

Fuentes:
Configuramos las fuentes:
nano /etc/apt/sources.list
#Etch
deb http://http.us.debian.org/debian etch main contrib non-free
#deb http://non-us.debian.org/debian-non-US etch/non-US main contrib non-free
deb http://security.debian.org etch/updates main contrib non-free
#deb http://www.debian-multimedia.org etch main
deb-src http://http.us.debian.org/debian etch main contrib non-free
#Para Oracle
deb http://oss.oracle.com/debian unstable main non-free
ctrl+ X, S
apt-get update


SSH:
apt-get install ssh

Webmin
apt-get install  libauthen-pam-perl libio-pty-perl  libmd5-perl libnet-ssleay-perl
wget http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin_1.410_all.deb
dpkg -i webmin_1.410_all.deb
Webmin install complete. You can now login to https://ip:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.
https://ip:10000/


Apache2 + PHP5
apt-get install apache2 php5 libapache2-mod-php5 php5-gd
a2enmod rewrite
/etc/init.d/apache2 force-reload


eAccelerator
apt-get install build-essential php5-dev
cd /tmp
wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
tar xvfj eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
phpize
./configure
make
make install
nano  /etc/php5/conf.d/eaccelerator.ini
Ponemos:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
mkdir -p /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator
/etc/init.d/apache2 restart


cURL
apt-get install php5-curl
/etc/init.d/apache2 reload


SSL
apt-get install openssl ssl-cert
apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi
a2enmod ssl
/etc/init.d/apache2 force-reload
openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout
/etc/apache2/apache.pem
Generating a 1024 bit RSA private key
...++++++
.................................++++++
writing new private key to '/etc/apache2/apache.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:MX
State or Province Name (full name) [Some-State]:DF
Locality Name (eg, city) []:Df
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:amartinezdec@abargon.com
chmod 600 /etc/apache2/apache.pem
nano /etc/apache2/sites-available/default
Cambiar:
NameVirtualHost *
por
NameVirtualHost *:80
NameVirtualHost *:443
Y agregrar dentro de la directiva <virtualhost>:
SSLEngine on
SSLCertificateFile /etc/apache2/apache.pem
SSLCertificateKeyFile /etc/apache2/apache.pem
ctrl+ X, S
nano  /etc/apache2/ports.conf
Agregrar:
Listen 443
ctrl+ X, S
/etc/init.d/apache2 reload
Probamos el PHP
nano /var/www/test.php
<?php phpinfo(); ?>
ctrl+ X, S
https://ip/test.php


MySQL
apt-get install mysql-server mysql-client php5-mysql

Webalizer
apt-get install webalizer

PHPmyAdmin
cd /var/www/
mkdir phpmyadmin
cd /var/www/phpmyadmin
wget http://superb-west.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.6-all-languages.zip
unzip phpMyAdmin-2.11.6-all-languages.zip
https://ip/phpmyadmin/
Ponemos un theme bonito
cd /var/www/phpmyadmin/themes/
wget  http://internap.dl.sourceforge.net/sourceforge/phpmyadmin/arctic_ocean-2.11a.zip
unzip arctic_ocean-2.11a.zip
nano  /var/www/phpmyadmin/config.inc.php
<?php
$cfg
['blowfish_secret'] = '8#$&/sdsad##'
$i 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['ThemeDefault']='arctic_ocean';
?>

ctrl+ X, S


Oracle XE
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle  -O- | sudo apt-key add -
apt-get update
apt-get install oracle-xe

Executing Post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

/etc/init.d/oracle-xe configure

Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:

Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to http://127.0.0.1:8080/apex

Para verlo remotamente entrar a: http://127.0.0.1:8080/apex, loguearse, Administration, Manage HTTP Access: Seleccionar:
Available from local server and remote clients
Ahora ya puedes acceder a la página de administración desde cualquier lugar. http://ip:8080/apex

VNC
apt-get install vncserver
vncserver -geometry 1024x768 -depth 24

New 'X' desktop is nombredemáquina:1

Starting applications specified in /etc/X11/Xsession
Log file is /root/.vnc/nombredemáquina:1.log


Conectarnos ipdemáquina:1

Saludos





Agregado VNC

Falta: PostgreSQL.
#33
Foro Libre / Un elePHPant muy lindo
16 Febrero 2008, 13:08 PM




;D ;D
#36
Ingeniería Inversa / Desamblar MSI
13 Diciembre 2007, 20:39 PM
Hola,

Actualmente estoy usando el resource tuner, va de lujo pero solo con exe's y dll's  :-\ necesito abrir un msi para extraer una imagen  :xD. Alguien conocerá una pa msi?

Gracias
#39
Desarrollo Web / Recomendando host
1 Noviembre 2007, 04:44 AM
Hola,

Abro este thread para recomendar algún(os) hosting de nuestra preferencia  ;) debido a que siempre inician un tema para lo mismo. Será un catálogo. Ejemplo:

empresadehosting.tld cPanel, 200mb de espacio, MySQL, 10 mails, manejo hasta 2 dominios y 5 subdominios. Gratis

otraempresadehosting.tld cPanel, 500mb de espacio, MySQL, 100 mails, manejo hasta 20 dominios y 10 subdominios. 200dlls cada año.

PD: No spam  :¬¬

Por el buen órden del foro.

Saludos,

Ing_Amc

Amplio catálogo: http://www.free-webhosts.com/
#41
PHP / MOVIDO: Coger url (php)
4 Octubre 2007, 20:44 PM