Editing version 3 of page APIs_GetParam (the most recent revision is 4)
Note: This page is defined as a special page, and as such its final state may be different from what you see here.
Use template:
None
API_Template
DevTrack_Template
Version_Template
==Subroutine Name
**GetParam**
==Explanation and Usage
GetParam retrieves a parameter from the script. This could be either a CGI environment variable, a script variable, a field from a submitted form, etc.
**Note** that as of [[Version 0.50]], `GetParam` will call `[[APIs QuoteHTML|QuoteHTML]]` on the parameter before returning it. So if you are expecting regular HTML in your data, you will have to call `[[APIs UnquoteHTML|UnquoteHTML]]` on it.
==Syntax
**`GetParam(Name, Default);`**
==Options
**Name** - This is the name of the parameter you want to get. This will retrieve any of the CGI environment variables, as well as any script actions. The `do` action tells you what the script is trying to do (posting, revision, history, etc). `page` will return the name of the current page.
**Default** - This is the value to return if the parameter is not set. This is entirely **optional**, however by default `GetParam` will return 0 if the parameter is not set. If you need anything else, be sure to call `GetParam` with a default value defined.
==Examples
These are actual examples from the Aneuch source code:
**`my $action = GetParam('doing');`**\\Here, the variable `$action` is set to the value of the `doing` parameter. If `doing` is not set, then `$action` will be 0 (since no default is defined).
This page is a template
This file is locked by 3.16.147.165 (ec2-3-16-147-165.us-east-2.compute.amazonaws.com) since Mon Apr 28 00:07:20 UTC 2025 . Lock should expire by Mon Apr 28 00:12:20 UTC 2025, and it is now Mon Apr 28 00:09:11 UTC 2025.
Upload a file
By contributing to this wiki, you acknowledge that you waive your right to claim copyright of your individual contributions. The text of this site is uncopyrighted and released to the public domain.
Show markup help Styling **bold **, //italic //, __underline __, --strikethrough--, `teletype ` Headers = Level 1 =, == Level 2 ==, === Level 3 ===, ==== Level 4 ====, ===== Level 5 ===== (ending ='s optional) Lists * Unordered List, # Ordered List, ** Level 2 unordered, ### Level 3 ordered (up to 5 levels, NO SPACES IN FRONT) Links [[Page]], [[Page|description]], [[http://link]], [[http://link|description]] Images {{image.jpg}}, {{right:image.jpg}} (right aligned), [[link|{{image.jpg}}]] (image linked to link), {{image.jpg|alt text}} Extras ---- (horizonal rule), ~~~~ (signature)