Can I use $_GET variable for query string on Regular Page?
Permalink
Hi Guys,
How does $_GET Variable works with Concrete5? Can I use that on regular page?
I know I can do this with single page via url segment, I'm just wondering if it is possible with regular page.
Example is :http://www.domain_name.com/about-us/?name=test...
How does $_GET Variable works with Concrete5? Can I use that on regular page?
I know I can do this with single page via url segment, I'm just wondering if it is possible with regular page.
Example is :http://www.domain_name.com/about-us/?name=test...
![JohntheFish](/files/avatars/51576.jpg)
Yes, works pretty much the same, but its probably better use $_POST if you can.
Thank you @JohntheFish,
What I'm working on is Custom Block, and I used GET var on my view and passed the GET value on one of my controller's function.
It is working when I'm in Edit mode or when I'm logged in but when I logged out. It doesnt work anymore.
Sample cod eon my view
What I'm working on is Custom Block, and I used GET var on my view and passed the GET value on one of my controller's function.
It is working when I'm in Edit mode or when I'm logged in but when I logged out. It doesnt work anymore.
Sample cod eon my view
$current_url = $controller->getCurrentUrl(); if(isset($_GET['album'])) { echo 'ALBUM: ' . $_GET['album']; } else { echo 'No GET VAR'; } <a href="<?php echo $current_url; ?>?album=123456789">click here</a>
Check for $_GET in the block controller view method with some debug code to dump it:
http://www.concrete5.org/documentation/how-tos/developers/concrete5...
http://www.concrete5.org/documentation/how-tos/developers/concrete5...
When logged out, c5 may be returning a cached block. You could check the cache settings in the block controller.
What do you mean by "You could check the cache settings in the block controller."
@JohntheFish,
Thank you so much for your help, Below is the current setup of my custom block cache.
Thank you so much for your help, Below is the current setup of my custom block cache.
protected $btCacheBlockRecord = true; protected $btCacheBlockOutput = true; protected $btCacheBlockOutputOnPost = true; protected $btCacheBlockOutputForRegisteredUsers = false; protected $btCacheBlockOutputLifetime = CACHE_LIFETIME;
I just turned off the cache on my controller. Thank you so much for your help.