Typo3: read URL parameter and display in template?

Posted on 2007-08-02
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:
 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)?
Question by:Smoerble
    LVL 15

    Accepted Solution

    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 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.

    Author Comment

    Thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    A Change in PHP Behavior with Session Write Short Circuit ( (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
    This article will show, step by step, how to integrate R code into a R Sweave document
    Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now