Gossamer Forum
Home : Products : Links 2.0 : Installation -- Windows :

Re: [PerlFlunkie] Links 2.0 and xampp

Quote Reply
Re: [PerlFlunkie] Links 2.0 and xampp In reply to
Hi Leonard - thank you for your reply.

I installed links completely in the directory : C:\xampp\htdocs\public_html\ .

Relevant parts of links.cfg :

Code:

$db_script_path = "C:/xampp/htdocs/public_html/cgi-bin/admin";
$db_dir_url = "http://localhost/public_html/cgi-bin/admin";

$db_cgi_url = "http://localhost/public_html/cgi-bin";

$build_root_path = "C:/xampp/htdocs/public_html/links";
$build_root_url = "http://localhost/public_html/links";

$build_image_url = "http://localhost/public_html/links/images";


Now I have a curios problem:

nph-build.cgi works (fine) if I commet out #&parse_form and start the script from the command line.
It doesn`t work if start with the browser : http://localhost/public_html/cgi-bin/admin/nph-build.cgi.

admin.cgi doesn`t work if started with the browser.

If start from the command line (perl -w admin.cgi) I receive an error message :

db_utils_pl:
Use of uninitialized value in string eq at
C:\xampp\htdocs\public_html\cgi-bin\admin\db_utils.pl
at line 562

The problem is probably the call of sub &parse_form in admin cgi.

admin.cgi:
Code:
#!C:/xampp/perl
#
#-/usr/bin/perl
#-/usr/local/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: admin.cgi
# Beschreibung: This is the administrative interface for the links program.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.01
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
#
# German Translation by Nicky
# http://www.nicky.net
# Deutsches Forum http://forum.nicky.net
#
# Required Librariers
# --------------------------------------------------------

eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
print "INC : " , @INC , "\n\n" ;
require 5.001; # Make sure we have at least perl 5.001.
# require "C:\\xampp\\htdocs\\public_html\\cgi-bin\\admin\\links.cfg";
require "links.cfg"; # Ändern Sie dieses zum vollen Pfad zu links.cfg, wenn Sie Probleme haben sollten.

print " db_lib_path : " , $db_lib_path , "\n\n";
require "$db_lib_path/db.pl"; # Database Routines.
require "$db_lib_path/db_utils.pl"; # Database Support utilities.
require "$db_lib_path/admin_html.pl"; # Admin HTML routines.
};

if ($@) {
print "Content-type: text/plain\n\n";
print "Fehler beim einlesen von dazugehörigen Bibliothek Dateien: $@\n";
print "Überprüfen Sie ob diese existieren, Pfade richtig eingestellt sind, und ob die Dateien richtig CHMOD-ed sind.";
exit;
}

# ========================================================
eval { &main; };
if ($@) { &cgierr("Allgemeiner Fehler: $@"); }
exit;
# ========================================================

sub main {
# --------------------------------------------------------

$| = 1 ;

%in = &parse_form ;


$in{'db'} ?
require "$db_lib_path/$in{'db'}.def" :
require "$db_lib_path/links.def";

$db_script_link_url = "admin.cgi?db=$in{'db'}";


if ($in{'add_form'}) { &html_add_form; }
elsif ($in{'add_record'}) { &add_record; }
elsif ($in{'add_record_mult'}) { &add_record_mult; }
elsif ($in{'view_search'}) { &html_view_search; }
elsif ($in{'view_records'}) { &view_records; }
elsif ($in{'delete_search'}) { &html_delete_search; }
elsif ($in{'delete_form'}) { &html_delete_form; }
elsif ($in{'delete_records'}) { &delete_records; }
elsif ($in{'modify_search'}) { &html_modify_search; }
elsif ($in{'modify_mult_form'}) { &html_modify_mult_form; }
elsif ($in{'modify_form'}) { &html_modify_form; }
elsif ($in{'modify_form_record'}) { &html_modify_form_record; }
elsif ($in{'modify_record'}) { &modify_record; }
elsif ($in{'modify_mult_record'}) { &modify_mult_record; }
elsif ($in{'validate_form'}) { &html_validate_form; }
elsif ($in{'validate_records'}) { &validate_records; }
elsif ($in{'check_links'}) { &check_links; }
elsif ($in{'fix_links'}) { &fix_links; }
elsif ($in{'check_duplicates'}) { &check_duplicates; }
elsif ($in{'html_mail_target'}) { &html_mail_target; }
elsif ($in{'html_mail_form'}) { &html_mail_form; }
elsif ($in{'html_mail_update'}) { &html_mail_update; }
elsif ($in{'html_edit_template'}) { &html_edit_template; }
elsif ($in{'save_template'}) { &save_template; }
elsif ($in{'html_template_help'}) { &html_template_help; }
elsif ($in{'display'} eq 'navigation') { &html_navigation; }
elsif ($in{'display'} eq 'body') { &html_body; }
elsif ($in{'display'} eq 'top') { &html_top; }
else { &html_home; }

# &cgierr("Done"); # Debugger

}

db_utils.pl : sub parseform
Code:
sub parse_form {
# --------------------------------------------------------

my (@pairs, %in);
my ($buffer, $pair, $name, $value );

if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
}
elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
}
else {
&cgierr('Dieser Script kann nicht aus Telnet gestartet werden.');
}

PAIR: foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);

$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

($value eq "---") and next PAIR;
exists $in{$name} ? ($in{$name} .= "~~$value") : ($in{$name} = $value);
}
return %in;
}


Andreas

Dr.Windows








Subject Author Views Date
Thread Links 2.0 and xampp SevenSpirits 29914 Oct 20, 2007, 5:04 AM
Thread Re: [SevenSpirits] Links 2.0 and xampp
PerlFlunkie 29291 Oct 21, 2007, 2:27 PM
Thread Re: [PerlFlunkie] Links 2.0 and xampp
SevenSpirits 29291 Oct 22, 2007, 5:45 AM
Post Re: [SevenSpirits] Links 2.0 and xampp
SevenSpirits 29285 Oct 22, 2007, 5:50 AM
Thread Re: [SevenSpirits] Links 2.0 and xampp
PerlFlunkie 29279 Oct 22, 2007, 10:33 AM
Thread Re: [PerlFlunkie] Links 2.0 and xampp
SevenSpirits 29277 Oct 22, 2007, 12:41 PM
Thread Re: [SevenSpirits] Links 2.0 and xampp
SevenSpirits 29270 Oct 22, 2007, 4:48 PM
Post Re: [SevenSpirits] Links 2.0 and xampp
PerlFlunkie 29268 Oct 22, 2007, 9:28 PM
Post Re: [SevenSpirits] Links 2.0 and xampp
chrisadam12 24710 Sep 5, 2010, 10:32 PM