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

All variables from $IN->param() into an array?

Quote Reply
All variables from $IN->param() into an array?
Hi....does anyone know how you would pass all of the variables from $IN->param() into an array? I have tried several ways....of which none have worked. The reason I need to do this, is to pass all the data from the input, and enter it into forms. I really dont wanna have to manually enter 50+ fields, with their names and values Unsure

Cheers for any help :)

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] All variables from $IN->param() into an array? In reply to
Enter it into forms how?....if you mean as tags then you want a hsahref not an array.

my $input = $IN->get_hash;
Quote Reply
Re: [Andy] All variables from $IN->param() into an array? In reply to
For an array (I forgot to tell you) I'd do:

my @values = values %{$IN->get_hash};
Quote Reply
Re: [Paul] All variables from $IN->param() into an array? In reply to
Sorry, should have explained better. I need to put them into an array, ready for using in a LSQL template call...

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] All variables from $IN->param() into an array? In reply to
That's what I meant in my first reply. If it is for a template you need a hashref.
Quote Reply
Re: [Paul] All variables from $IN->param() into an array? In reply to
Mmmm..I have;

Code:
my $values = $IN->get_hash;

print $IN->header() unless defined;
Links::SiteHTML::display('ecard_preview', $values );

Its not giving an error, but simply a blank page Unsure Am I doing something wrong?

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] All variables from $IN->param() into an array? In reply to
Yea.

>>
print $IN->header() unless defined;
<<

This isn't doing what you think it is. What are you trying to determine is defined or not?
Quote Reply
Re: [Paul] All variables from $IN->param() into an array? In reply to
So what would do that then? (print the header, only if defined) ?

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: [Paul] All variables from $IN->param() into an array? In reply to
Eugh...found the reason it wasn't printing! I was missing a 'print' before the Links::SiteHTML Crazy

Stupid or what!

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] All variables from $IN->param() into an array? In reply to
>>
So what would do that then? (print the header, only if defined) ?
<<

GT::CGI handles that automatically anyway.

You can't just use "defined" in the way you did - see the perldoc for defined.

http://www.perldoc.com/...od/func/defined.html

...so basically the first sentence should tell you that the way you have it, defined is checking whether $_ is defined or not.