Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro
Author Message
spyrule
Worker
Worker



Joined: Jun 06, 2006
Posts: 105

PostPosted: Mon Nov 13, 2006 11:45 pm Reply with quote

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
 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue Nov 14, 2006 7:43 am Reply with quote

where is it for ?
and why should it be used ?
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Nov 14, 2006 8:01 am Reply with quote

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

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
spyrule







PostPosted: Tue Nov 14, 2006 10:10 am Reply with quote

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 [ Only registered users can see links on this board! Get registered or login! ] 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...

Smile

Thanks in advance,

Spyrule
 
spyrule







PostPosted: Tue Nov 14, 2006 9:15 pm Reply with quote

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
 
evaders99







PostPosted: Wed Nov 15, 2006 12:35 am Reply with quote

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();
}
 
spyrule







PostPosted: Wed Nov 15, 2006 1:29 am Reply with quote

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
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©