#! /usr/bin/perl
use DBI;
push(@INC,"e:\\html\\test\\cgi-bin");
require "myvars.pl";
print "Content-type: text/html\n\n";
use CGI;
$q = new CGI;
$handle = $q->cookie(-name=>'handle');
$user = $q->cookie(-name=>'name');
$ref = $q->param("ref");
$reftype = $q->param("reftype");
my $dbh = DBI->connect( $dbName, $dbUser, $dbPw) ||
die "Kann keine Verbindung zum MySQL-Server aufbauen: $DBI::errstr\n";
my $sth = $dbh->prepare("select name, mail, www from users where name = '$user'");
my $results = $sth->execute() or die "Kann Abfrage nich ausführen: $DBI::errstr\n";
if (my @result = $sth->fetchrow_array )
{
$user = $result[0];
$mail = $result[1];
$www = $result[2];
}
$sth->finish();
$dbh->disconnect();
my $dbh = DBI->connect( $dbName, $dbUser, $dbPw) ||
die "Kann keine Verbindung zum MySQL-Server aufbauen: $DBI::errstr\n";
my $sth = $dbh->prepare("select title from $reftype where c = $ref");
my $results = $sth->execute() or die "Kann Abfrage nich ausführen: $DBI::errstr\n";
if (my @result = $sth->fetchrow_array)
{
open(FH, ")
{
print $_;
}
close (FH);
print "";
open(FH, ")
{
print $_;
}
close (FH);
}
else
{
print "Internal Error: Referer ($number) not found
";
}
$sth->finish();
$dbh->disconnect();