Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7163003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:49:41+00:00 2026-05-28T13:49:41+00:00

I have made a simple plugin with a form but it won’t post when

  • 0

I have made a simple plugin with a form but it won’t post when I’m not logged in.
Here is the file class.tx_gctest_pi1.php, created with Kickstarter.

require_once(PATH_tslib.'class.tslib_pibase.php');

class tx_gctest_pi1 extends tslib_pibase {
    var $prefixId      = 'tx_gctest_pi1';       // Same as class name
    var $scriptRelPath = 'pi1/class.tx_gctest_pi1.php'; // Path to this script relative to the extension dir.
    var $extKey        = 'gc_test'; // The extension key.
    var $pi_checkCHash = true;

    function main($content, $conf) {
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();

        if($_POST) {
            echo 'test';
        }

        $content='
            <strong>This is a few paragraphs:</strong><br />
            <p>This is line 1</p>
            <p>This is line 2</p>

            <h3>This is a form:</h3>
            <form action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" method="POST">
                <input type="text" name="'.$this->prefixId.'[input_field]" value="'.htmlspecialchars($this->piVars['input_field']).'">
                <input type="submit" name="'.$this->prefixId.'[submit_button]" value="'.htmlspecialchars($this->pi_getLL('submit_button_label')).'">
            </form>
            <br />
            <p>You can click here to '.$this->pi_linkToPage('get to this page again',$GLOBALS['TSFE']->id).'</p>
        ';

        return $this->pi_wrapInBaseClass($content);
    }
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/gc_test/pi1/class.tx_gctest_pi1.php']) {
    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/gc_test/pi1/class.tx_gctest_pi1.php']);
}

?>

This will output test when logged in and nothing when not logged in.
The page is reloaded but no post is sent

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:49:42+00:00Added an answer on May 28, 2026 at 1:49 pm

    I think this has not much to do with logged in / logged out. TYPO3 caches content unless you tell it to not cache.

    echo var_dump print_r debug are methods that directly display things through php. TYPO3 doesn’t catch them. If you want to have something displayed, add it to e.g. $content and return $content at the end of main(). The return value of main() gets cached.

    You can try this by clearing your cache in backend and refresh the page. echo etc is displayed. after a new reload, it is gone.

    So, how to solve this? There are a few possibilities

    • make the page that contains your plugin uncached
    • make the plugin itself uncached

    I would suggest you find out what you really want to do and then write your code that is is using caching.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made my own file type (.ddd) and I made a simple program
I have started using jQuery and rails. I have made a simple form that
I have a simple nav made up of the following HTML; <div class=inner> <div
Heavy emphasis on simple. I've never made an installer and I'd rather not have
I have a simple question, but I couldn't solve it by myself. I made
I have menu made with Superfish jquery plugin http://users.tpg.com.au/j_birch/plugins/superfish But i have some problems
I have made a simple test application for the issue, two winforms each containing
I'm just playing around with WPF and MVVM, and I have made a simple
I have made a very simple AppleScript to close tabs in Safari. The problem
in my application I made a very simple binding. I have a NSMutableArray bound

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.