Jump to content
MakeWebGames

Gamebase URL


Recommended Posts

This is meant to return my domain name. However, it returns "localhost"

I have not altered the code. So I don't know why this is happening. Can someone please help me out.

function determine_game_urlbase()

{

$domain = $_SERVER['HTTP_HOST'];

$turi = $_SERVER['REQUEST_URI'];

$turiq = '';

for ($t = strlen($turi) - 1; $t >= 0; $t--)

{

if ($turi[$t] != '/')

{

$turiq = $turi[$t] . $turiq;

}

else

{

break;

}

}

$turiq = '/' . $turiq;

if ($turiq == '/')

{

$domain .= substr($turi, 0, -1);

}

else

{

$domain .= str_replace($turiq, '', $turi);

}

return $domain;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...