[TYPO3-ect] AJAX GET and POST variables

Franz Holzinger franz at fholzinger.com
Fri Nov 3 15:31:29 CET 2006


Hello  olly,

>>>> E.g. the L-parameter gets lost and therefore no language translation
>>>> is used.
> 
> Hm, why aren't you calling the server-side script with the "&L" as GET
> variable?
> 
> For instance:
> 
> class some_pi1 {
>   function main(...) {
>     $reqURI = 'index.php?'.$somePage.'&L='.t3lib_div::_GP('L');
>       // or even better, use $this->cObj->typoLink, that should
>       // integrate the L-parameter, if defined in TS linkVars
> 
>     $xajax = t3lib_div::makeInstance('tx_xajax');
>     $xajax->setRequestURI($reqURI);
> 
>     ...
>   }
> }
> 
Many thanks! I did not know about this possibility.

The error has been in this line of tt_products: (fetched from a XAJAX 
tutorial)

$this->xajax->setRequestURI(t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT') 
. '?' . htmlspecialchars(t3lib_div::getIndpEnv('QUERY_STRING') ));

which has resulted in:
$reqURI = http://localhost/myhomepage/index.php?id=125&L=1

This is the correct call:
$reqURI = t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT') . '?' . 
t3lib_div::getIndpEnv('QUERY_STRING');


Greets,

Franz




More information about the TYPO3-team-extension-coordination mailing list