PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
spyrule
Worker
Worker


Joined: Jun 06, 2006
Posts: 105

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

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 Back to top

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 Back to top

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
View user's profile Send private message Visit poster's website
spyrule
Worker
Worker


Joined: Jun 06, 2006
Posts: 105

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

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 to the forums!
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
View user's profile Send private message Visit poster's website
spyrule
Worker
Worker


Joined: Jun 06, 2006
Posts: 105

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

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
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

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

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();
}
View user's profile Send private message Visit poster's website
spyrule
Worker
Worker


Joined: Jun 06, 2006
Posts: 105

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

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
View user's profile Send private message Visit poster's website
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum