Jump to content
MakeWebGames

Recommended Posts

Posted

i am currently making an outter header for my game and have hit a stop in it that i can figure out with 1 page i want to use in game and outgame so the part i use is

if($_SESSION['loggedin']==1)

{

include "globals.php";

}

elseif($_SESSION['loggedin']==0)

{

include "main_globals.php";

}

i am putting this at the top of the page i want to work in game and out game but it only seems to work with ingame ive tried doing this loads dif ways like just putting else and tried it removing the else so it just the if statement could someone please help me with this please

Posted

how else would i do this without the IF statement as i have made an outside globals called main_globals.php and that includes the outside styles as i was saying i need to check if user is loggedin or out so the page shows the correct style for the page so if loggedin ==0 then outside style and loggedin==1 inside style of the game the only way i would know of doing this is the way ive done it checking to see if the loggedin session is there as some pages i want to use inside and outside the game e.g forums , tos, contact so i need to find a way for it to check if they loggedin then pull the style from inside or outside the game

Posted

outside file -

include "main_globals.php";

inside file -

include "globals.php";

really don't see the point in an if() anyway try isset

session_start();
if(isset($_SESSION['loggedin']))
{
include "globals.php";
}
else
{
include "main_globals.php";
}
Posted

still doing the same as before it is only showing 1 style when loggedin it shows the page but when i logout it dont show the out header it just redirects back to the loggin page like it is only showing the inside globals

Posted
still doing the same as before it is only showing 1 style when loggedin it shows the page but when i logout it dont show the out header it just redirects back to the loggin page like it is only showing the inside globals

It's been some time since i picked v2 up and looked at it.

anyway...

Did you create the 2nd globals file using the 1st one as a template? if so look for anything in it that checks if there logged in e.g.

if ($_SESSION['loggedin'] {
   header("Location: login.php");
}

i think thats what v2 has in it anyway

Posted

firstly im trying to make 1 page work within the inside and outside of the game and header ive made for outside the game aswell as inside as all the outside all take the same style so made sense to make a new header for that

Posted
What are you actually trying to do?

 

Please don't forget the header is only INSIDE game...

I don't think it's so much a header as a layout that fits in with the loggedin look. So he would have the same css (color coding) etc.

@ NationGamer - did you make sure there is nothing in the outside "header" that checks if they are loggedin.

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...