Welcome, Guest. Please login or register.
July 23, 2025, 07:10:06 PM

Login with username, password and session length

Search:     Advanced search
we're back, baby
*
Home Help Search Login Register
f13.net  |  f13.net General Forums  |  General Discussion  |  Topic: PHP Help 0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: PHP Help  (Read 2652 times)
Roberik Manders
Terracotta Army
Posts: 74


on: August 19, 2008, 03:49:02 PM

I'm currently working on a PHP web application to work in the EVE Online in-game browser (IGB). However, I'm heaving some trouble with my first bit of code.

The first thing the code does is check the browser to see if it's running in the IGB, and if not, to ask the user to run it in the IGB. This seems to work fine. After this it then checks to see if the site is trusted within the IGB, and if not to send a request to make the site trusted. This piece of code worked fine in another example I used, but doesn't seem to be working here. The last piece of code checks the players alliance, and if they are in a particular alliance, it will allow them access, or not if they're in a different alliance.

When opening in the IGB I simply get a blank page. No errors or anything, simply blank.

Here is the block of code I'm currently working on:
Code:
<?

if ( $HTTP_SERVER_VARS["HTTP_USER_AGENT"] != "EVE-minibrowser" ) // Identify browser and allow / disallow access.
{
echo "Please open this page in the EVE in-game browser.";
}

elseif ( $HTTP_SERVER_VARS["HTTP_EVE_TRUSTED"] == "no" ) // Check site is trusted and request if not.
{
header("eve.trustme:http://fat.evil-blue.co.uk/::This site must be trusted in order for you to access it.");
}

elseif ( $HTTP_SERVER_VARS["HTTP_EVE_ALLIANCENAME"] != "Vanguard." ) // Verify alliance and allow / disallow access.
{
echo "Thou art a spy!";
}
else
{
echo "Welcome to FAT Intel";
}

?>


Here are some links to the IGB documentation I'm using:

http://bughunters.addix.net/igbtest/IGB-commands.html
http://bughunters.addix.net/igbtest/

My current work in progress is uploaded for testing here.

If anyone can take a look and help me with this it would be much appreciated. The code looks fine to me, but I'm not that experience with PHP so I'm probably missing something.

Thanks. :)
« Last Edit: August 19, 2008, 03:56:52 PM by Roberik Manders »

Worship Google! Use Chrome!
Miasma
Terracotta Army
Posts: 5283

Stopgap Measure


Reply #1 on: August 19, 2008, 03:58:43 PM

When I view the source in eve all it gives is the "Please open this page in the EVE in-game browser." statement.  Perhaps the game browser demands properly formed html with <html> and <body> tags etc.  The first if statement isn't working either since I get that message in game.

Just to be clear I also get a blank page and can only see the text with a right click view source.
Trippy
Administrator
Posts: 23657


Reply #2 on: August 19, 2008, 04:05:30 PM

Dump out all the environment variables (i.e. the full contents of $HTTP_SERVER_VARS) onto the page and see what they are all set to.
Ookii
Staff Emeritus
Posts: 2676

is actually Trippy


WWW
Reply #3 on: August 19, 2008, 04:15:39 PM

When I view the source in eve all it gives is the "Please open this page in the EVE in-game browser." statement.

That's funny, when I fake my user agent in Firefox to be what it wants, it gets to "thou art a spy".  Maybe the user agent has changed and that's the source of the problem?

Also it looks from a quick search that it's not just Eve-minibrowser, it's Eve-minibrowser/2.01a or some nosense. Apparently you have to allow for a variable ending at the end of the user agent.  My favorite solution though is most people just look for the trusted bit and assume if that is set that you're using the browser as that Var is unique to the IGB.

Salamok
Terracotta Army
Posts: 2803


Reply #4 on: August 19, 2008, 04:33:43 PM

When I view the source in eve all it gives is the "Please open this page in the EVE in-game browser." statement.

That's funny, when I fake my user agent in Firefox to be what it wants, it gets to "thou art a spy".  Maybe the user agent has changed and that's the source of the problem?

Also it looks from a quick search that it's not just Eve-minibrowser, it's Eve-minibrowser/2.01a or some nosense. Apparently you have to allow for a variable ending at the end of the user agent.  My favorite solution though is most people just look for the trusted bit and assume if that is set that you're using the browser as that Var is unique to the IGB.

thats the message you get if your alliance isn't set to "Vanguard." so your faking the user agent worked but you didn't set an alliance.
Salamok
Terracotta Army
Posts: 2803


Reply #5 on: August 19, 2008, 04:43:46 PM

Also, make sure you aren't echoing anything to the screen prior to the header redirects, if you are doing these be sure and use the ob_start and ob_end_flush.
Ookii
Staff Emeritus
Posts: 2676

is actually Trippy


WWW
Reply #6 on: August 19, 2008, 06:13:44 PM

Oh my point was when I faked my user agent it worked correctly while it wasn't working when they used the IGB.  That made me think the user agent is wrong in the code, which it most likely is.

Viin
Terracotta Army
Posts: 6159


Reply #7 on: August 20, 2008, 09:27:38 AM

The IGB is very picky about HTML, it has to be strict 1.0 HTML or it won't work. So if you are outputting an error message, make sure you do it inside BODY/HTML tags.

- Viin
Roberik Manders
Terracotta Army
Posts: 74


Reply #8 on: August 20, 2008, 05:53:13 PM

I got it working thanks to your help. The HTML tags are needed, I overlooked that which was a bit silly tbh. The IGB is EVE-Minibrowser/3.0 or something like that, I altered the code to reflect this and it works perfectly now. If the version number changes again it'll be a simple matter to reflect this in the code until I can find a more permanent solution.

Thank you. :)

Worship Google! Use Chrome!
Salamok
Terracotta Army
Posts: 2803


Reply #9 on: August 21, 2008, 06:54:29 AM

maybe something like:

if (stripos($HTTP_SERVER_VARS["HTTP_USER_AGENT"], "eve"))


Pages: [1] Go Up Print 
f13.net  |  f13.net General Forums  |  General Discussion  |  Topic: PHP Help  
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC