kalabox Posted February 15, 2006 Report Share Posted February 15, 2006 Sveiki kaarteejo reizi :) gribēju pajautāt kaads nevar palīdzēt..? kaa var dabūt gatavu, ka tevi pāradresē no kāedas lapas uz kādu citu konkrētu lapu? piem ar noteiktu laika limitu? Link to comment Share on other sites More sharing options...
teror Posted February 15, 2006 Report Share Posted February 15, 2006 šitas no manuāļa, izvēlies sev tīkamāko veidu: A function to redirect, using different approaches. The destination page can include a full URL, a full path or a local path. <? function g_redirect($url,$mode) /* It redirects to a page specified by "$url". * $mode can be: * LOCATION: Redirect via Header "Location". * REFRESH: Redirect via Header "Refresh". * META: Redirect via HTML META tag * JS: Redirect via JavaScript command */ { if (strncmp('http:',$url,5) && strncmp('https:',$url,6)) { $starturl = ($_SERVER["HTTPS"] == 'on' ? 'https' : 'http') . '://'. (empty($_SERVER['HTTP_HOST'])? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']); if ($url[0] != '/') $starturl .= dirname($_SERVER['PHP_SELF']).'/'; $url = "$starturl$url"; } switch($mode) { case 'LOCATION': if (headers_sent()) exit("Headers already sent. Can not redirect to $url"); header("Location: $url"); exit; case 'REFRESH': if (headers_sent()) exit("Headers already sent. Can not redirect to $url"); header("Refresh: 0; URL=\"$url\""); exit; case 'META': ?><meta http-equiv="refresh" content="0;url=<?=$url?>" /><? exit; default: /* -- Java Script */ ?><script type="text/javascript"> window.location.href='<?=$url?>'; </script><? } exit; } ?> Link to comment Share on other sites More sharing options...
kalabox Posted February 15, 2006 Author Report Share Posted February 15, 2006 ok, liels paldies :) Link to comment Share on other sites More sharing options...
Stopp Posted February 15, 2006 Report Share Posted February 15, 2006 <meta http-equiv="refresh" content="3; url=http://gofuckyourself.com/"/> tas pēc 3 sekundēm pāradresēs tevi uz gofuckyourself.com. to pašu var izdarīt arī ar php: header("refresh: 3;url=http://gofuckyourself.com/"); Link to comment Share on other sites More sharing options...
Recommended Posts