Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Typo3: read URL parameter and display in template?

Posted on 2007-08-02
2
Medium Priority
?
597 Views
Last Modified: 2008-01-09
I bet it is very simle but I am just too dumb. I have the following code in Typo3 template:
-------------------
IMPORTED-MENU = PHP_SCRIPT_EXT
IMPORTED-MENU {
 file = fileadmin/smo_latesttopics_export.php
}
-------------------

The URL will have a parameter named "act".

3 questions:
1) How should the code look like that I display the value of the paramater at the marker "IMPORTED-MENU"?
2) What is the code that the parameter will be used "as is" when calling the include?
3) Is it possible to use a variable in typoScript that can be used from the PH include too? (to avoid calling the include wiht a parameter in the URL)?
0
Comment
Question by:Smoerble
2 Comments
 
LVL 15

Accepted Solution

by:
m1tk4 earned 2000 total points
ID: 19659719
First - I am not sure "-" is allowed as a part of TS object name, however I may be wrong.

1. <? echo t3lib_div::_GET('act'); ?>

You can also go for the GET/POST variables directly, however if you use RealURL or some other extensions your scripts will be broken. This is why you need to go through the standard TYPO3 API - see http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.1.0/view/3/2/#id3526172 for details

2. Not sure I understand the question. The code configured as "PHP_SCRIPT_EXT" is called using include() from the core, so all global variables available at that moment are available to it too. There are no parameters passed to it since it's not a function - there are only parameters passed to the whole PHP application and stored in the global vars.

3. There are several ways to do it. What is the nature of informaiton that you are trying to pass to your script? Depending on whether it is page-specific, template specific or otherways there could be options.
0
 

Author Comment

by:Smoerble
ID: 19676286
Thanks for your help.
Regards
Smo
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question