Gossamer Forum
Quote Reply
Mmm, what the heck!
Hi,

Man, this is a REALLY odd one. Never ever come across this :/

The following code:

Code:
use strict;
use lib '/home/domain.com/cgi-bin/art/admin';
use Links qw/$IN $DB $CFG $USER/;
use GT::SQL;
use Links::SiteHTML;
use Links::Plugins;
use CGI::Carp qw(fatalsToBrowser);

local $SIG{__DIE__} = \&Links::fatal;

Links::init('/home/domain.com/cgi-bin/art/admin');

Links::init_user();


print $IN->header;
use Data::Dumper;
print Dumper($USER);

# no point in letting them past if they are not logged in... so check here...
if (!$USER->{Username}) {
print "WHY ARE WE HERE!!!!";
print $IN->redirect( );
exit;
}


This script is in 2 stages ;

Code:
if ($IN->param('action')) { &do_update; } else { &show_form; }

The "show_form()" works fine - and $USER is populated , but once you click the submit button, $USER is blank - and just prints out:

Quote:
$VAR1 = undef; WHY ARE WE HERE!!!!

..anyone got any ideas? (its not just my PC, as it was reported as a bug by someone else)

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mmm, what the heck! In reply to
Hi Andy,

by looking at the code I have no idea.
It would be interesting to know what name/value pairs are submitted by the form or to see the form template.
Just a guess but if the session is stored within a cookie and the script url is called with www.xyz.com and the form is submitted without www there might be a cookie problem.
Probably you´ve already checked that.

Regards

Niko

Last edited by:

el noe: Mar 25, 2009, 10:32 AM
Quote Reply
Re: [el noe] Mmm, what the heck! In reply to
Hi,

The weird thing was, after just re-installing this plugin - it all worked fine (so maybe something was editing before, that I wasn't aware of)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mmm, what the heck! In reply to
Trace it back. Find out where the code detects the session id and then see if it is picked up properly from the cookie, then check if the record is being pulled from the database etc, then just work through the process to pinpoint the problem.