[TYPO3-dev] Web- address + returnUrl

Tapio Markula tapio.markula at atwebteam.com
Sat Jan 13 22:39:25 CET 2007


Steffen Kamper kirjoitti:
> Hi Tapio,
> 
> "Tapio Markula" <tapio.markula at atwebteam.com> schrieb im Newsbeitrag 
> news:mailman.1.1168719432.16720.typo3-dev at lists.netfielders.de...
>> Martin Kutschker kirjoitti:
>>> Tapio Markula schrieb:
>>>> Hi
>>>>
>>>> How to define returnUrl correctly
>>>>
>>>> I would make some specific returnUrl for page
>>>> modules, which has some extra parameters
>>>>
>>>> $returnUrl='&returnUrl='.htmlspecialchars(t3lib_extMgm::siteRelPath('templavoila').'mod1/index.php?id='.$id.$thisUser.$languagePar);
>>>
>>> You should use rawurlencode() on the query parts instead of 
>>> htmlspecialchars(). Use htmlspecialchars only one of the whole URL.
>>>
>>> Masi
>> ok seems to work
>> I put also
>> $myGET=t3lib_div::_GET();
>> ...
>>
>> also get param through that - ok? 
>> $returnUrl='&returnUrl='.rawurlencode($myGET['returnUrl']);
> 
> you can use it, also 
> $returnUrl='&returnUrl='.rawurlencode(t3lib_div::_GP('returnUrl'));
> 
>> BTW. I have still one problem. SQL-queries should in priciple work also 
>> with other database as mysql
>>
>> I have currenlty used mysql_query and mysql_fetch_array for new queries
>> but Stefan Galinky said that I should ask Typo3 database functions,
>> which would make queries to work also with other database than just mysql
>> Can you give exact answer
>> how to replace
>> $pageMaxItem = mysql_query("SELECT MAX(uid) FROM 
>> pages;",$GLOBALS['TYPO3_DB']->link);
>> $pageMaxItem=mysql_fetch_array($pageMaxItem);
>> with functions, which are not depending of mysql database.
>>
> no problem, use
> 
> $res=$GLOBALS['TYPO3_DB']->exec_SELECTquery(
>    'MAX(uid)',
>    'pages',
>    '', #where
>    '', #group
>    '', #order
>    '' #limit
> );
>  $row=$GLOBALS['TYPO3_DB']->sql_fetch_row($res);
> 

thank's
I replaced

$query = "SELECT uid FROM pages_language_overlay WHERE pid=".$id.";"; 
$ouid=mysql_query($query,$GLOBALS['TYPO3_DB']->link);
#$ouid=mysql_fetch_array($ouid);

with
				$ouid=$GLOBALS['TYPO3_DB']->exec_SELECTquery(
    'uid',
    'pages_language_overlay',
    'pid=".$id."', #where
    '', #group
    '', #order
    '' #limit
);

$oiud=$GLOBALS['TYPO3_DB']->sql_fetch_row($ouid);

that didn't worked because the result was not correct

some udpate queries also needed, for example:

$query = "UPDATE be_users set cookiedata='".$userCookiedata."' WHERE 
username='".$userName."';";
mysql_query($query,$GLOBALS['TYPO3_DB']->link);			
			




More information about the TYPO3-dev mailing list