[php] how to?

hi, i wonder how it is made that when i enter http://crossfire.nu/ , it automaticcaly redirects to http://crossfire.nu/?x=home

is it made with <link refresh etc.
or some php expression?

$_GET[x] = "news"; obviously cant work as it doesnt force browser to refresh with including given value of x.

maybe .htacces?
You just make index.html redirecting to that address? :P
dont get it :/
what about

header("location: http://www.google.de");
arr, this be true
you used it?

well, i just tried that header() function. there's a problem :/
when i made that one:
header("location: http://google.pl");
it worked (fast).
but when i tried that one:
header("location: http://pentel.ovh.org/?x=home");
site doesnt want to load (loading... forever) :/
?x=home is just short for index.php?x=home, so wenn u only call crossfire.nu in ur browser, it loads the index page of that directory, that reloads itself with the default value for x set.
edit: or a 303 redirection setup in .htaccess loading index.php?x=home when only index.php is called.
edit2: or just mod_rewrite in work / i stop thinkin about how many ways u could setup that now, my brain goes in circles already ( /me walks away mumblin to himself rippin off his hairs :S)
ok but which way is the fastest and the least resources-eating one? :)
if i would code the script i would do smth like

switch ($_GET['x'])
case "news":
case "whatever":

u wont have it visible in the url then, but it doesnt use any apache extensions to give the results. else just mod_redirect in .htaccess(u wont notice anything in speed even with higher loaded websites).
thats not what i asked about. i include subpages with simple if/else, so thats no problem.

if ($x == ""){
$x = "home";
if(file_exists($includedir . "$x" . ".php")){
include($includedir . "$x" . ".php");
} else {
$x = "home";

(where $x == $_GET[x])

i was wondering how page is immediately set to ?x=news. i think ill just use header("location
"... else just mod_redirect in .htaccess(u wont notice anything in speed even with higher loaded websites). "
mod_rewrite i meant :S
rofl @ Adi =)
Or just use a html script for your index.html

<meta http-equiv="refresh" content="20; URL=http://web7.alpha187.server4you.de//">
<meta name="keywords" content="automatic redirection">
If your browser doesn't automatically go there within a few seconds,
click <a href="http://web7.alpha187.server4you.de//">here</a>

Or if you want it in a new browser window:

<script language="javascript" type="text/javascript">

Choose the script that u want :) I hope it helps u, HF !
Back to top