Estoy elaborando un directorio de enlaces sin Mysql, ni BBDD. He encontrado un script en la red para hacerlo, pero por mas que sigo los pasos no me sale.
He dado los permisos oportunos en el servidor, pero creo que el error es el no estar familiarizado con este lenguaje de scripts.
Si quiero que mi domino sea: "http:www.enlacesparatodos.com"... ¿¿¿¿como debería configurar el siguiente script...????
Mil gracias de antemano.
Using perl Syntax Highlighting
#! /usr/bin/perl
#
# WEB-IT Internet Services
# Add Link v 1.1
#-------------------------------------------------------------------#
# Installation Instructions:
#-----------------------------
#
# 1: change the settings below to what your settings are!!!
# 2: Copy this file link.pl to your cgi-bin
# 3: Copy the links.html to a separate directory
# eg /links/
# 4: chmod links.pl to 755
# 5: chmod links.html to 777
# 6: chmod /links/ to 777
# 7: change all of the settings below to your servers settings
# 8: make sure to set links.html to call link.pl
#-------------------------------------------------------------------#
#################################### Settings ###################################
# UNIX PATH TO directory.html
$file = "/links.html";
# URL TO directory.html
$gto = "http://193.180.246.209/links.html";
# ADD LINKS TO TOP OR BOTTOM (1 = top 2 = bottom)
$top = "1";
#################################################################################
# Get the input data
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Parse the data
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# get rid of the % encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if(! $allow_html) {
$value =~ s/<([^>]|\n)*>//g;
}
$FORM{$name} = $value;
}
open(FILES, "$file") || die "Can't open FILE: $file\n";
@files =<FILES>;
close(FILES);
open(FILES, ">$file") || die "Can't open FILE: $file\n";
foreach $line (@files) {
if($line =~ /<!--Begin Directory-->/i) {
if($top) {
print FILES "<!--Begin Directory-->\n";
}
print FILES "<br><li><a href=$FORM{'url'}>$FORM{'name'}</a>\n";
if(! $top) {
print FILES "<!--Begin Directory-->\n";
}
}
else {
print FILES "$line";
}
}
close(FILES);
print "Location: $gto\n\n";
#
# WEB-IT Internet Services
# Add Link v 1.1
#-------------------------------------------------------------------#
# Installation Instructions:
#-----------------------------
#
# 1: change the settings below to what your settings are!!!
# 2: Copy this file link.pl to your cgi-bin
# 3: Copy the links.html to a separate directory
# eg /links/
# 4: chmod links.pl to 755
# 5: chmod links.html to 777
# 6: chmod /links/ to 777
# 7: change all of the settings below to your servers settings
# 8: make sure to set links.html to call link.pl
#-------------------------------------------------------------------#
#################################### Settings ###################################
# UNIX PATH TO directory.html
$file = "/links.html";
# URL TO directory.html
$gto = "http://193.180.246.209/links.html";
# ADD LINKS TO TOP OR BOTTOM (1 = top 2 = bottom)
$top = "1";
#################################################################################
# Get the input data
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Parse the data
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# get rid of the % encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if(! $allow_html) {
$value =~ s/<([^>]|\n)*>//g;
}
$FORM{$name} = $value;
}
open(FILES, "$file") || die "Can't open FILE: $file\n";
@files =<FILES>;
close(FILES);
open(FILES, ">$file") || die "Can't open FILE: $file\n";
foreach $line (@files) {
if($line =~ /<!--Begin Directory-->/i) {
if($top) {
print FILES "<!--Begin Directory-->\n";
}
print FILES "<br><li><a href=$FORM{'url'}>$FORM{'name'}</a>\n";
if(! $top) {
print FILES "<!--Begin Directory-->\n";
}
}
else {
print FILES "$line";
}
}
close(FILES);
print "Location: $gto\n\n";
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4