# Forums | Mahara Community

## Developers / GET ID

Posts: 41

02 July 2019, 3:26

Hello,

I have a small question. Is there a easy way to get the id from the url?
I think the normal $_GET ['id'] is blocked ... Is this function?$groupid = param_integer('id');

Thank you!

Posts: 708

### Re: GET ID

02 July 2019, 11:35

Hi

Yes if you are wanting to get an integer value from the url you can use:

$id = param_integer('id'); if you are wanting the page to load both in instances with or without an id supplied$id = param_integer('id', null);

if you are wanting the page to load both in instances with or without an id supplied but want to default to a specific value, eg '27'

\$id = param_integer('id', 27);

There are similar options for a string

param_alpha() -- for alpha strings only

param_alphanum() -- for alpha stings and numbers

param_alphanumext() -- for alpha strings / numbers / underscore / dot / dash

param_variable() -- no checking done so not recommended to use

(only use if you can't control the info coming from 3rd party application)

Cheers

Robert

Posts: 41

### Re: GET ID

02 July 2019, 22:22

Hello,

Thanks for this useful informations!
Now everything is clearer, thank you!!

Antonella
3 results