Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to pass Variable from admin.cgi to Links.pm

Quote Reply
How to pass Variable from admin.cgi to Links.pm
Hi,
How do you pass a variable (or constant) from admin.cgi to Links.pm, so I can check its value in Links.pm and right a condition to do something.

Thank you
Mark
Quote Reply
Re: [Mark2] How to pass Variable from admin.cgi to Links.pm In reply to
Anyone please...
Quote Reply
Re: [Mark2] How to pass Variable from admin.cgi to Links.pm In reply to
Depends on whether this is a GET request or a POST request.

GET request: just put in the url, e.g admin.cgi?key=value

POST request: add a <input name="key" value="value"> tag on a template.

In Links.pm, the variable will be accessible through

$IN->param('key')

I hope that helps. BTW: in order to have easier updates to new versions, you might want to consider making a plugin, instead of changeing the code in Links.pm.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] How to pass Variable from admin.cgi to Links.pm In reply to
Thank you Ivan for your answer.
What I am intending to do, is to use a different ADMIN TEMPLATE set then the one already used (.../templates/admin); therefore, I created a new admin template set called (....templates/MyAdmin); therefore, in Links.pm I have to specify the name of the new template in sub admin... procedure, depends on which file admin.cgi, or adminNew.cgi (which is a copy of admin.cgi but to use the new templates) file calls it; therefore, I need something like this:

in admin.cgi
========
$whichTemplate = 77;

in adminNew.cgi
========
$whichTemplate = 78;

ok now I need to pass this variable/constant to Links.pm so I can check its value? how would I do that?

I am trying to do something in Links.pm like this:

if $whichTemplate = 77 {
use ...templates/admin templates
}

if $whichTemplate = 78 {
use ...templates/Myadmin templates
}

That is all..
I need to pass the variable from admin.cgi or adminNew.cgi to Links.pm

Thank you again
Mark

Last edited by:

Mark2: Nov 8, 2002, 11:18 AM