Author |
Message |
spyrule
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jun 06, 2006
Posts: 105
|
Posted:
Mon Nov 13, 2006 11:45 pm |
|
Hello,
I have my website (www.hammerandfist.com), and I was wondering where I could place a browser detection script to redirect to a different site, for a specific browser type.
This is mainly for the eve-online's In Game Browser (IGB for short),
I have the code, but cannot get it to work, without always getting an
"error on line blah blah in /header.php"
Is this the correct place to place :
Code:
<?
ini_alter("session.use_cookies","1");
ob_start();
if (!(strpos($HTTP_USER_AGENT,"EVE-minibrowser")===TRUE))
{
// PLACE REDIRECT HERE
}
else
{
// PLACE NORMAL HEADER INFO HERE
}
?>
Anybody help me here?
Thanks in advance,
spyrule
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
Sells PC To Pay For Divorce
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined:
Posts: 5661
|
Posted:
Tue Nov 14, 2006 7:43 am |
|
where is it for ?
and why should it be used ? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
Former Moderator in Good Standing
![](modules/Forums/images/avatars/803d73f6452557b947721.jpg)
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Tue Nov 14, 2006 8:01 am |
|
I would place it directly into mainfile.php - as the redirect may use the header() command that needs to be done before any other output is generated |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spyrule
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Nov 14, 2006 10:10 am |
|
hitwalker..
The reason for this, is because eve-online's in game browser, is a very constrained browser (not a full browser). So I want website membership to be linked to in-game capabilities. I am effectivly trying to build a tool that will allow
me to track membership attendance, and the last time they played. (if your not familiar with eve, "corporations" and alliances, can have several thousand members, and so I do not want to try and track that manually. What I want is so that when a member goes to www.hammerandfist.com, it detects for the IGB browser, if there, then send them to a sub-domain (igb.hammerandfist.com), otherwise display as normal.
What the tool will do, is both track the last time they we're logged in, and then also track several other things for myself, and for the players. The game has the ability to send this information back out, so the IGB should be able to update my nuke database with data. So it's just a matter of coding that to happen.
and evaders99, thanks for the tip, now I just have to figure out where to code it...
Thanks in advance,
Spyrule |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spyrule
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Nov 14, 2006 9:15 pm |
|
ok...
I don't have a clue where to add this in the mainfile.php file... I really am trepidatious to go farting around in the mainfile.php file.. I do not feel like screwing up my website as it is.
any help... HUGELY apreciated.
spyrule |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Nov 15, 2006 12:35 am |
|
I'm not sure why you need all this code
Code:
ini_alter("session.use_cookies","1");
ob_start();
|
I would put this at the top of mainfile.php after the copyrights
Code:
if (!(strpos($HTTP_USER_AGENT,"EVE-minibrowser")===TRUE))
Header("Location: http://www.newsite.com");
die();
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spyrule
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Nov 15, 2006 1:29 am |
|
got it working,
thank you!
btw, here is the final code required to get it to work :
Code:
$br1 = strtolower($_SERVER['HTTP_USER_AGENT']);
if(ereg("eve-minibrowser/3.0", $br1)) {
header("location: http://igb.hammerandfist.com/");
} else {
//header("location: http://www.hammerandfist.com/");
}
|
Now I realize this makes the code not at all flexible for the detection method, but the browser, is updated about once every year... so no big deal.
thanks again,
spyrule |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|