Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/08/2008, 12:46
HalconVigia
 
Fecha de Ingreso: abril-2003
Ubicación: Mexico
Mensajes: 604
Antigüedad: 21 años, 9 meses
Puntos: 23
Respuesta: problema con XAMP al ejecutar CGI

buenas!!

no de hecho es un administrador de espacio web

aqui pongo parte del codigo

#!perl

use Fcntl;
use AnyDBM_File;

$ENV{'PATH_TRANSLATED'} =~ s/\\/\//g;
$ENV{'PATH_TRANSLATED'} =~ s/\/(\w)+\.(\w)+$//;
$ENV{'SCRIPT_FILENAME'} =~ s/\/(\w)+\.(\w)+$//;
if (length($ENV{'SCRIPT_FILENAME'}) >1) { $path = $ENV{'SCRIPT_FILENAME'}; } else {$path=$ENV{'PATH_TRANSLATED'};}

require "$path/cgi-lib.pl";
&ReadParse;

print "Content-type: text/html\n\n";

# Check if WebHost is installed..
open (CONFIG,"$path/config.txt");
$config=<CONFIG>;
close (CONFIG);
if ($config =~ /not_installed/) { &install; exit; }

# Configure
open (CONFIG,"$path/config.txt");
while (<CONFIG>) { if ($_ =~ /\n/) { chop $_; } @config=split(/=/,$_,2); $config{$config[0]}=$config[1]; }
close (CONFIG);

# Open user database if not already open
$flags = O_CREAT | O_RDWR;
$db = "$config{'data_dir'}/users";
tie(%users, 'AnyDBM_File', $db , $flags, 0666) || &error_html("Can't open user database ($db): $!");

if (!$in{'login_password'}) { &login_html; exit; }
if (crypt($in{'login_password'}, as) ne $config{'admin_password'}) { &error_html("Wrong password"); }

realmente no tiene gran complicacion, son cosas relativamente sencillas


alguna idea???
__________________
¡El Respeto al Derecho Ajeno Es la Paz!