Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

View all variables in $IN?

Quote Reply
View all variables in $IN?
Is their a way to print out all the variables in the $IN hash? With an array, I would just use;

foreach $line (@array) { print $line. "<BR>"; }

Any ideas? I feel pretty stupid for making this post Frown

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] View all variables in $IN? In reply to
Try;

foreach $line ($IN->param) { print $line. "<BR>"; }

Like in CGI. $IN->get_hash(); will give you a hash reference to all the data
Quote Reply
Re: [Aki] View all variables in $IN? In reply to
Hi..that worked great, but it proved my fear :(

It printed out;

Description
Title
OfferDiscount
URL
CatLinks.CategoryID
d
add
Contact_Name
Contact_Email
Type
State

As you can see, nothing referencing the user that is logged in. How easy would it be to grab the username of the person trying to add the link?

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] View all variables in $IN? In reply to
This will hopefully give you all the info you need

Code:
use Links qw/ $IN $DB $CFG $USER /;



# and somewhere

if ( $USER ) {

require GT::Dumper;

print GT::Dumper->dump( $USER );

}

else {

print "no user logged in";

}
Quote Reply
Re: [Aki] View all variables in $IN? In reply to
Mmm...all it seems to do is print;

= undef;

Any ideas?

Cheers for the help so far Smile

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] View all variables in $IN? In reply to
Make sure the calling script also calls init_user(). I think you'll find an example of the calling convention in page.cgi. What USER should contain is a hashed record of everything found for the user in the Users table. Unimpressed
Quote Reply
Re: [Aki] View all variables in $IN? In reply to
I already have Links::init_user called. See my top part here;

Code:
use strict;
use GT::Base;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB $USER/;
Links::init_user();

# Inherit from base class for debug and error methods
@Plugins::Check_User_Add::ISA = qw(GT::Base);

# Your code begins here! Good Luck!

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] View all variables in $IN? In reply to
Can you add this call

Links::init("path/to/admin");

before you call init_user?
Quote Reply
Re: [Aki] View all variables in $IN? In reply to
Did that....still giving;

= undef;

Unsure

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] View all variables in $IN? In reply to
mind sending me the source?
Quote Reply
Re: [Aki] View all variables in $IN? In reply to
Can I send you mine too? (just kidding)Angelic


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Andy] View all variables in $IN? In reply to
You are logged in when trying the code?

I don't have that much experience really but I'll try to help, unless of course you have already sent your code to Aki.

Last edited by:

PerlPod: Aug 21, 2002, 12:26 PM
Quote Reply
Re: [PerlPod] View all variables in $IN? In reply to
Hi PerlPud, I am the big guy around here so I say who helps who.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] View all variables in $IN? In reply to
Ok I am sorry, my mistake. Hope I didn't offend anyone.
Quote Reply
Re: [PerlPod] View all variables in $IN? In reply to
Hi newby,

I'm about half as big as Ian, so you can also listen to me if you like.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] View all variables in $IN? In reply to
LOL...its newbie, not newby, as in my name, Andrew Newby Wink

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: [Aki] View all variables in $IN? In reply to
>>>mind sending me the source? <<<

PMing it to you now...

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] View all variables in $IN? In reply to
Ok..got it worked out now. I just needed to use $USER->{Username} . Not sure why your code didn't print out all the values within $USEr Unsure

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!