Ik heb een nieuw UBB forum (11 dagen oud) (zie mijn signature voor de link), maar ik heb erg groot problem namelijk met "login" en "cookies"...
Bekijk alsjeblieft even de code en kijk of je het werkend kunt maken..PLEASE! Ik ben onderhand wanhopig...
Het probleem is dat sommige mensen die zich geregistreerd hebben helemaal niet kunnen inloggen!? Ik had het eerst ook, maar door het "security level" van Internet Explorer van "default" naar "LOW" te zetten kon ik wel inloggen (maar dat is natuurlijk geen goede oplossing). Iedere keer als ik online ga en het forum wil bezoeken moet ik elke keer weer opnieuw handmatig inloggen.
Zoals je aan de link kunt zien wordt mijn forum GEREDIRECT...kan dit het "cookie" & "login" probleem veroorzaken?
Hoe krijg ik het voor elkaar om mijn forum net zo goed te krijgen als Tweakers.net kwa login/cookies etc?

Ik verlies bezoekers zo.... "sigh"
# UBB LOGIN PAGE
$MainButtonsLine = &MainButtonOptions;
# standard top of HTML page
print "$Header";
print <<LOGINHTML;
<center>
$standard_title_table
<br />
$TBT
<tr bgcolor="$vars_style{AltColumnColor1}">
<td valign="bottom" align="left">
<font size="1" face="$vars_style{FontFace}">
<b>»
$show_logout_noreg
</b>
</font>
</td>
<td valign="bottom" align="right">
<font size="1" face="$vars_style{FontFace}"><b>
<a href="$ULTIMATEBB">$vars_config{BBName}</a> » $vars_wordlets{login_now}
</b></font>
</td>
</tr>
$TBB
<br />
<table cellpadding="0" border="0" width="$vars_style{TableWidth}">
<tr>
<td colspan="2" align="left">
<font size="2" face="$vars_style{FontFace}">
<b>» $vars_wordlets{need_to_register_bold}</b> <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=agree">$vars_wordlets{need_to_register_link}</a>
<br />
<b>» $vars_wordlets{lost_password_bold}</b> <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=lost_password">$vars_wordlets{lost_password}</a>
</font>
</td>
</tr>
</table>
</center>
<center>
<form action="$vars_config{CGIURL}/ultimatebb.cgi" method="post">
<input type="hidden" name="ubb" value="do_login" />
<input type="hidden" name="refer" value="$ENV{'HTTP_REFERER'}" />
$TBT
<tr bgcolor="$vars_style{TableColorStrip}">
<td colspan="2">
<font color="$vars_style{TableStripTextColor}" size="$vars_style{TextSize}" face="$vars_style{FontFace}"><b>
$vars_wordlets{login_to} $vars_config{BBName}
</b></font>
</td>
</tr>
<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$vars_wordlets{login_name}:
</font>
</td>
<td align="left">
<input type="text" name="username" size="30" maxlength="40" />
</td>
</tr>
<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$vars_wordlets{password_field}:
</font>
</td>
<td align="left">
<input type="password" name="password" size="25" maxlength="30" />
</td>
</tr>
$TBB
<br />
<center>
<input type="submit" name="submit" value="$vars_wordlets{login_now}" />
</center>
</form>
</center>
<br />
LOGINHTML
# standard bootom of HTML page
print "$Footer";
# Nothing below this line should be changed.. and there is no more code!
# This entire program is copyright Infopop Corporation.
# For more info on the Ultimate Bulletin Board and other Infopop
# Products/Services, visit: http://www.infopop.com
# You may not distribute this program in any manner, modified or otherwise.
# You make modifications, but only for your own use and within the confines of the UBB License Agreement.
# DANGER: Do not remove the following line!
1;
# $Id: public_login.pl,v 1.3 2002/01/31 23:34:48 cvscapps Exp $
package UBBCGI::Cookie;
# Copyright 1995-1999, Lincoln D. Stein. All rights reserved.
# It may be used and modified freely, but I do request that this copyright
# notice remain attached to the file. You may modify this module as you
# wish, but if you redistribute a modified version, please attach a note
# listing the modifications you have made.
$UBBCGI::Cookie::VERSION='1.12';
use UBBCGI qw(-no_debug);
use overload '""' => \&as_string,
'cmp' => \&compare,
'fallback'=>1;
# fetch a list of cookies from the environment and
# return as a hash. the cookies are parsed as normal
# escaped URL data.
sub fetch {
my $class = shift;
my $raw_cookie = $ENV{HTTP_COOKIE} || $ENV{COOKIE};
return () unless $raw_cookie;
return $class->parse($raw_cookie);
}
# fetch a list of cookies from the environment and
# return as a hash. the cookie values are not unescaped
# or altered in any way.
sub raw_fetch {
my $class = shift;
my $raw_cookie = $ENV{HTTP_COOKIE} || $ENV{COOKIE};
return () unless $raw_cookie;
my %results;
my($key,$value);
my(@pairs) = split("; ",$raw_cookie);
foreach (@pairs) {
if (/^([^=]+)=(.*)/) {
$key = $1;
$value = $2;
}
else {
$key = $_;
$value = '';
}
$results{$key} = $value;
}
return \%results unless wantarray;
return %results;
}
sub parse {
my ($self,$raw_cookie) = @_;
my %results;
my(@pairs) = split("; ",$raw_cookie);
foreach (@pairs) {
my($key,$value) = split("=");
my(@values) = map UBBCGI::unescape($_),split('&',$value);
$key = UBBCGI::unescape($key);
# A bug in Netscape can cause several cookies with same name to
# appear. The FIRST one in HTTP_COOKIE is the most recent version.
$results{$key} ||= $self->new(-name=>$key,-value=>\@values);
}
return \%results unless wantarray;
return %results;
}
sub new {
my $class = shift;
$class = ref($class) if ref($class);
my($name,$value,$path,$domain,$secure,$expires) =
UBBCGI->rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES],@_);
# Pull out our parameters.
my @values;
if (ref($value)) {
if (ref($value) eq 'ARRAY') {
@values = @$value;
} elsif (ref($value) eq 'HASH') {
@values = %$value;
}
} else {
@values = ($value);
}
bless my $self = {
'name'=>$name,
'value'=>[@values],
},$class;
# IE requires the path and domain to be present for some reason.
$path = UBBCGI::url(-absolute=>1) unless defined $path;
# however, this breaks networks which use host tables without fully qualified
# names, so we comment it out.
# $domain = CGI::virtual_host() unless defined $domain;
$self->path($path) if defined $path;
$self->domain($domain) if defined $domain;
$self->secure($secure) if defined $secure;
$self->expires($expires) if defined $expires;
return $self;
}
sub as_string {
my $self = shift;
return "" unless $self->name;
my(@constant_values,$domain,$path,$expires,$secure);
push(@constant_values,"domain=$domain") if $domain = $self->domain;
push(@constant_values,"path=$path") if $path = $self->path;
push(@constant_values,"expires=$expires") if $expires = $self->expires;
push(@constant_values,'secure') if $secure = $self->secure;
my($key) = UBBCGI::escape($self->name);
my($cookie) = join("=",$key,join("&",map UBBCGI::escape($_),$self->value));
return join("; ",$cookie,@constant_values);
}
sub compare {
my $self = shift;
my $value = shift;
return "$self" cmp $value;
}
# accessors
sub name {
my $self = shift;
my $name = shift;
$self->{'name'} = $name if defined $name;
return $self->{'name'};
}
sub value {
my $self = shift;
my $value = shift;
$self->{'value'} = $value if defined $value;
return wantarray ? @{$self->{'value'}} : $self->{'value'}->[0]
}
sub domain {
my $self = shift;
my $domain = shift;
$self->{'domain'} = $domain if defined $domain;
return $self->{'domain'};
}
sub secure {
my $self = shift;
my $secure = shift;
$self->{'secure'} = $secure if defined $secure;
return $self->{'secure'};
}
sub expires {
my $self = shift;
my $expires = shift;
$self->{'expires'} = UBBCGI::expires($expires,'cookie') if defined $expires;
return $self->{'expires'};
}
sub path {
my $self = shift;
my $path = shift;
$self->{'path'} = $path if defined $path;
return $self->{'path'};
}
1;
Bekijk alsjeblieft even de code en kijk of je het werkend kunt maken..PLEASE! Ik ben onderhand wanhopig...
Het probleem is dat sommige mensen die zich geregistreerd hebben helemaal niet kunnen inloggen!? Ik had het eerst ook, maar door het "security level" van Internet Explorer van "default" naar "LOW" te zetten kon ik wel inloggen (maar dat is natuurlijk geen goede oplossing). Iedere keer als ik online ga en het forum wil bezoeken moet ik elke keer weer opnieuw handmatig inloggen.
Zoals je aan de link kunt zien wordt mijn forum GEREDIRECT...kan dit het "cookie" & "login" probleem veroorzaken?
Hoe krijg ik het voor elkaar om mijn forum net zo goed te krijgen als Tweakers.net kwa login/cookies etc?
Ik verlies bezoekers zo.... "sigh"
# UBB LOGIN PAGE
$MainButtonsLine = &MainButtonOptions;
# standard top of HTML page
print "$Header";
print <<LOGINHTML;
<center>
$standard_title_table
<br />
$TBT
<tr bgcolor="$vars_style{AltColumnColor1}">
<td valign="bottom" align="left">
<font size="1" face="$vars_style{FontFace}">
<b>»
$show_logout_noreg
</b>
</font>
</td>
<td valign="bottom" align="right">
<font size="1" face="$vars_style{FontFace}"><b>
<a href="$ULTIMATEBB">$vars_config{BBName}</a> » $vars_wordlets{login_now}
</b></font>
</td>
</tr>
$TBB
<br />
<table cellpadding="0" border="0" width="$vars_style{TableWidth}">
<tr>
<td colspan="2" align="left">
<font size="2" face="$vars_style{FontFace}">
<b>» $vars_wordlets{need_to_register_bold}</b> <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=agree">$vars_wordlets{need_to_register_link}</a>
<br />
<b>» $vars_wordlets{lost_password_bold}</b> <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=lost_password">$vars_wordlets{lost_password}</a>
</font>
</td>
</tr>
</table>
</center>
<center>
<form action="$vars_config{CGIURL}/ultimatebb.cgi" method="post">
<input type="hidden" name="ubb" value="do_login" />
<input type="hidden" name="refer" value="$ENV{'HTTP_REFERER'}" />
$TBT
<tr bgcolor="$vars_style{TableColorStrip}">
<td colspan="2">
<font color="$vars_style{TableStripTextColor}" size="$vars_style{TextSize}" face="$vars_style{FontFace}"><b>
$vars_wordlets{login_to} $vars_config{BBName}
</b></font>
</td>
</tr>
<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$vars_wordlets{login_name}:
</font>
</td>
<td align="left">
<input type="text" name="username" size="30" maxlength="40" />
</td>
</tr>
<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$vars_wordlets{password_field}:
</font>
</td>
<td align="left">
<input type="password" name="password" size="25" maxlength="30" />
</td>
</tr>
$TBB
<br />
<center>
<input type="submit" name="submit" value="$vars_wordlets{login_now}" />
</center>
</form>
</center>
<br />
LOGINHTML
# standard bootom of HTML page
print "$Footer";
# Nothing below this line should be changed.. and there is no more code!
# This entire program is copyright Infopop Corporation.
# For more info on the Ultimate Bulletin Board and other Infopop
# Products/Services, visit: http://www.infopop.com
# You may not distribute this program in any manner, modified or otherwise.
# You make modifications, but only for your own use and within the confines of the UBB License Agreement.
# DANGER: Do not remove the following line!
1;
# $Id: public_login.pl,v 1.3 2002/01/31 23:34:48 cvscapps Exp $
package UBBCGI::Cookie;
# Copyright 1995-1999, Lincoln D. Stein. All rights reserved.
# It may be used and modified freely, but I do request that this copyright
# notice remain attached to the file. You may modify this module as you
# wish, but if you redistribute a modified version, please attach a note
# listing the modifications you have made.
$UBBCGI::Cookie::VERSION='1.12';
use UBBCGI qw(-no_debug);
use overload '""' => \&as_string,
'cmp' => \&compare,
'fallback'=>1;
# fetch a list of cookies from the environment and
# return as a hash. the cookies are parsed as normal
# escaped URL data.
sub fetch {
my $class = shift;
my $raw_cookie = $ENV{HTTP_COOKIE} || $ENV{COOKIE};
return () unless $raw_cookie;
return $class->parse($raw_cookie);
}
# fetch a list of cookies from the environment and
# return as a hash. the cookie values are not unescaped
# or altered in any way.
sub raw_fetch {
my $class = shift;
my $raw_cookie = $ENV{HTTP_COOKIE} || $ENV{COOKIE};
return () unless $raw_cookie;
my %results;
my($key,$value);
my(@pairs) = split("; ",$raw_cookie);
foreach (@pairs) {
if (/^([^=]+)=(.*)/) {
$key = $1;
$value = $2;
}
else {
$key = $_;
$value = '';
}
$results{$key} = $value;
}
return \%results unless wantarray;
return %results;
}
sub parse {
my ($self,$raw_cookie) = @_;
my %results;
my(@pairs) = split("; ",$raw_cookie);
foreach (@pairs) {
my($key,$value) = split("=");
my(@values) = map UBBCGI::unescape($_),split('&',$value);
$key = UBBCGI::unescape($key);
# A bug in Netscape can cause several cookies with same name to
# appear. The FIRST one in HTTP_COOKIE is the most recent version.
$results{$key} ||= $self->new(-name=>$key,-value=>\@values);
}
return \%results unless wantarray;
return %results;
}
sub new {
my $class = shift;
$class = ref($class) if ref($class);
my($name,$value,$path,$domain,$secure,$expires) =
UBBCGI->rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES],@_);
# Pull out our parameters.
my @values;
if (ref($value)) {
if (ref($value) eq 'ARRAY') {
@values = @$value;
} elsif (ref($value) eq 'HASH') {
@values = %$value;
}
} else {
@values = ($value);
}
bless my $self = {
'name'=>$name,
'value'=>[@values],
},$class;
# IE requires the path and domain to be present for some reason.
$path = UBBCGI::url(-absolute=>1) unless defined $path;
# however, this breaks networks which use host tables without fully qualified
# names, so we comment it out.
# $domain = CGI::virtual_host() unless defined $domain;
$self->path($path) if defined $path;
$self->domain($domain) if defined $domain;
$self->secure($secure) if defined $secure;
$self->expires($expires) if defined $expires;
return $self;
}
sub as_string {
my $self = shift;
return "" unless $self->name;
my(@constant_values,$domain,$path,$expires,$secure);
push(@constant_values,"domain=$domain") if $domain = $self->domain;
push(@constant_values,"path=$path") if $path = $self->path;
push(@constant_values,"expires=$expires") if $expires = $self->expires;
push(@constant_values,'secure') if $secure = $self->secure;
my($key) = UBBCGI::escape($self->name);
my($cookie) = join("=",$key,join("&",map UBBCGI::escape($_),$self->value));
return join("; ",$cookie,@constant_values);
}
sub compare {
my $self = shift;
my $value = shift;
return "$self" cmp $value;
}
# accessors
sub name {
my $self = shift;
my $name = shift;
$self->{'name'} = $name if defined $name;
return $self->{'name'};
}
sub value {
my $self = shift;
my $value = shift;
$self->{'value'} = $value if defined $value;
return wantarray ? @{$self->{'value'}} : $self->{'value'}->[0]
}
sub domain {
my $self = shift;
my $domain = shift;
$self->{'domain'} = $domain if defined $domain;
return $self->{'domain'};
}
sub secure {
my $self = shift;
my $secure = shift;
$self->{'secure'} = $secure if defined $secure;
return $self->{'secure'};
}
sub expires {
my $self = shift;
my $expires = shift;
$self->{'expires'} = UBBCGI::expires($expires,'cookie') if defined $expires;
return $self->{'expires'};
}
sub path {
my $self = shift;
my $path = shift;
$self->{'path'} = $path if defined $path;
return $self->{'path'};
}
1;