passing get variables. PLEASE HELP. How to?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
barrycogan

passing get variables. PLEASE HELP. How to?

Post by barrycogan »

Hi folks,

I have been searching on how to send get variables from one page to the next in simple cms. I have two sets of php code each in a user defined tag. one that displays a list of posts (works fine) and a second that displays the details of the post and comment(s). The first page needs to send an id over to the next page. how can it be done?

my config settings are:

Code: Select all

#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = false;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = true;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
All that needs to be done is get one var from one page to another. It can't be that hard but i can not seem to make it work

Please help

PS : I apologize if this subject has already been posted. I was not able to find it by "search".
barrycogan

Re: passing get variables. PLEASE HELP. How to?

Post by barrycogan »

Thanks for that link. It helped with assigning variables when you know specifically what one to pass. This however can be any variable passed to the the page. I'll try explain in more detail.

Browse_Page:
Template file with UDT for php browse posts.
index.php/get/ideas_pool/

Post_Page:
Template file with UDT for php display post details.
index.php/get/ideas_pool/user_idea/

Outside of cmsMadeSimple it worked like this:

Browse_Page:
list of links like the one below:

Code: Select all

<a href="Post_Page.php?var1=5" class="hlink">My post title</a>
Post_Page:
Takes the get variable var1 and uses the value (5) to find that post in the database.

I tried using session variables but doest work as it will always show the last post created in the Browse_Page.

I need to find a solution like:

Code: Select all

http://someaddress/index.php/get/ideas_pool/user_idea/?var1=1
or
http://someaddress/index.php/get/ideas_pool/user_idea/1/
allaboutseb

Re: passing get variables. PLEASE HELP. How to?

Post by allaboutseb »

Barry, i am also interested in this. Have you found a solution?

Thanks,

Seb
Post Reply

Return to “Developers Discussion”