TYPO3 userFunc give GET Parameter to php file -
i including php file via userfunc , want give parameter "?session_start=1" , use in function.
ts:
includelibs.voucher = fileadmin/php/shop_init.php lib.phpscript = user lib.phpscript.userfunc = voucher->init lib.phpscript.session_start_var = gp:session_start
php file
<?php class voucher { public function init($content ="", $conf){ $session_start = $conf['session_start_var']?t3lib_div::_gp($conf['session_start_var']):false; $lang_id = ($globals['tsfe']->sys_language_uid == 0 ? "&lang=de" : "&lang=en"); if($_get["session_start"] == "" && $_get["tx"] == "" && strpos($_server['http_user_agent'], 'safari')){ if($_get["type"] == 1) die(header("location:http://xx.pro/post?shop=1&s=1&referer=http://$_server[http_host]$_server[request_uri]$lang_id")); elseif($_get["type"] == 2) die(header("location:http://xx.pro/post?shop=2&s=1$lang_id")); elseif($_get["type"] == 3) die(header("location:http://xx.pro/post?shop=3&s=1$lang_id")); else die(header("location:http://xx.pro/post?s=1$lang_id")); } return "<iframe id='frame-one' scrolling='no' frameborder='0' style='".($_get["type"] == "" ? "height:1640px;" : "height:1640px;")." width:100%;' src='http://xx.pro/post/index.php?view=".$_get["view"]."&tx=".$_get["tx"]."&st=".$_get["st"]."&amt=".$_get["amt"]."&type=".$_get["type"]."$lang_id' ></iframe>"; } } ?>
when echo $session_start output = gp:session_start , not 1
thx in advance
i think assign gp wrong, try this:
includelibs.voucher = fileadmin/php/shop_init.php lib.phpscript = user lib.phpscript.userfunc = voucher->init lib.phpscript.userfunc.session_start_var = text lib.phpscript.userfunc.session_start_var.data = gp:session_start
Comments
Post a Comment