Dvije akcije u jednoj funkciji PHP?

Imam problem s PHP-om:

zelio bih da mi funkcija

function stayThere(){

$cururl_sendform = JRequest::getURI();

if(($pos = strpos($cururl_sendform, “index.php”))!== false){

$cururl_sendform = substr($cururl_sendform,$pos);

}

$cururl_sendform = JRoute::_($cururl_sendform);

return $cururl_sendform;

}

još uradi sljedeće: osim ove akcije da još i linka na neku stranicu…

da li se to radi ovako ??

function stayThere(){

$cururl_sendform = JRequest::getURI();

if(($pos = strpos($cururl_sendform, “index.php”))!== false){

$cururl_sendform = substr($cururl_sendform,$pos);

}

$cururl_sendform = JRoute::_($cururl_sendform);

return $cururl_sendform;

goto("Location: http://www.google.com ");

}

pokušao sam ,ali mi ne linka,tj,ne preusmjeri

hvala

[quote=“kraic”]Imam problem s PHP-om:

zelio bih da mi funkcija

function stayThere(){

$cururl_sendform = JRequest::getURI();

if(($pos = strpos($cururl_sendform, “index.php”))!== false){

$cururl_sendform = substr($cururl_sendform,$pos);

}

$cururl_sendform = JRoute::_($cururl_sendform);

return $cururl_sendform;

}

još uradi sljedeće: osim ove akcije da još i linka na neku stranicu…

da li se to radi ovako ??

function stayThere(){

$cururl_sendform = JRequest::getURI();

if(($pos = strpos($cururl_sendform, “index.php”))!== false){

$cururl_sendform = substr($cururl_sendform,$pos);

}

$cururl_sendform = JRoute::_($cururl_sendform);

return $cururl_sendform;

goto("Location: http://www.google.com ");

}

pokušao sam ,ali mi ne linka,tj,ne preusmjeri

hvala[/quote]

[php]function stayThere(){

$cururl_sendform = JRequest::getURI();

if(($pos = strpos($cururl_sendform, “index.php”))!== false){

$cururl_sendform = substr($cururl_sendform,$pos);

}

$cururl_sendform = JRoute::_($cururl_sendform);

return $cururl_sendform;

header("Location: http://www.google.com ");

}[/php]

goto("Location: http://www.google.com ");
umjesto goto stavi header i trebalo bi funkcionirati


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja