Feature #2745
Makes that values can be POST on a redirected page
| Status: | Closed | Start date: | 2009-03-03 | |
|---|---|---|---|---|
| Priority: | Could have | Due date: | ||
| Assignee: | Fabien Udriot | % Done: | 100% |
|
| Category: | Frontend | |||
| Target version: | Beta v1.0 | |||
| Votes: | 0 |
Description
This is a nice to have feature:
It would be nice to be able to POST values whenever a page is redirected to an other one. Let's say a form is redirected to a page called "thank you for your email". On this page you may want some personal display like "Thanks you Mrs Dupont...". To do this, we need to re-post the values to the new page.
This feature would be configurable of course!
I am still search how to realized that. I have maybe a clue with cURL.
Associated revisions
[Bug 2745] Add radio buttons rent/sale and filter the list view accordingly, r=saskia
[Bug 2745] Add radio buttons rent/sale and filter the list view accordingly, r=saskia
History
Updated by Reinhard Führicht about 4 years ago
I like the feature, but I don't like using cURL to implement it. I'd like to try not using PHP extensions which could be disabled by the hosting provider.
In this case, it's kind of impossible to perform this task without using special PHP extensions.
If it is not possible to implement this feature without any special PHP extension, I would suggest to not implement it at all because I do not want to have something like "Only possible if..." in the manual.
Updated by Fabien Udriot about 4 years ago
- Target version set to Beta v1.0
True. I thought cURL was a default requirement for T3. But in fact it is a recommendation when using with proxy.
http://wiki.typo3.org/Typo3_Installation_Basics#System_requirements
Anyway, I think a quick way is to store the data in the session. I saw something about that in the recent post.
When using an extension like "typoscriptce", it will be possible to access the session with a simple stdWrap.
10 = TEXT
10.dataWrap = Thanks dear {TSFE:fe_user|user|mailformplusplus|last_name}
Updated by Reinhard Führicht about 4 years ago
I am quite sure you found this possibility too while doing research: Add a form which submits itself.
http://www.webmasterworld.com/forum88/2365.htm
It's not a very nice solution, but it works and will do the job.
Updated by Fabien Udriot about 4 years ago
- Status changed from New to Accepted
I checked the link but honestly I found all techniques a bit tricky. I prefer for the moment to store the info in the session (if you don't see any drawback for the rest of the extension.)
A POST request happens between the client and the target server. The data isn't included in the headers or even the URL (as it would be with a GET request), but as a seperate payload. This means that your only client based choice really is an auto-submitting form sent to the browser.
Updated by Reinhard Führicht about 4 years ago
Thanks for your work! Will think about it and give you feedback after the weekend.
Updated by Fabien Udriot about 4 years ago
Oups! I am almost finished with the implementation. I suggest, I submit my code and you adapt it if you think it is worth.
I put that option not in the Redirect Finisher but rather in the Default Controller. If the webmaster has checked / set the option "Store data in session when submitting the form", then the data are stored for further / any uses. (not only for the redirection)
Updated by Fabien Udriot about 4 years ago
Commited r17559 : new configuration option "storeGP" in TS. This option is also available in the flexform. I have updated the documentation too.
File impacted:
M doc/manual.sxw
M Resources/XML/flexform_ds.xml
M Resources/Language/locallang_tca.xml
M Classes/Controller/F3_MailformPlusPlus_Controller_Default.php
M Examples/full_ts_setup.ts
I let you see the way it is done. On my side, this issue can be closed.
Updated by Reinhard Führicht about 4 years ago
is this option also checked in Controller_Multistep? If not, please add it there too and the issue can be closed.
Updated by Fabien Udriot about 4 years ago
Yes. I added in method process() of Controller_Multistep.
// Validate the configuration, throw a possible exception $this->validateConfig($settings);
method validateConfig() is inherit from Controller_Default.
Updated by Reinhard Führicht about 4 years ago
I meant this method in Controller_Default:
protected function storeGPinSession() {
foreach ($this->gp as $key => $value) {
$GLOBALS['TSFE']->fe_user->setKey('ses',$key , $value);
}
}
This method gets overwritten in Controller_Multistep because there it was needed for some other stuff. Should we add a parent() call there or have I missed something?
Updated by Fabien Udriot about 4 years ago
I was out of topic!
When I called the method storeGPinSession(), I didn't notice it was already used in Controller_MultiStep.
I changed this: storeGPinSession() becomes storeUserGPInSession(). Furthemore, I updated Controller_MultiStep in order to have the same behaviour as Controller_Default.
Code already submitted. If you see a better method naming, feel free to adapt it.
Updated by Reinhard Führicht about 4 years ago
- Status changed from Accepted to Closed
- % Done changed from 0 to 100
Looks nice