Jump to content

Athene

Members
  • Posts

    3
  • Joined

  • Last visited

Athene's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I tried to change to "User", capital U, but it didn't change anything. Adding the domain didn't help anything either.I am testing in IE, online. I don't know much about the server since it's not really my server, I just know it's placed somewhere in America. I'll need to ask the owner about OS and such.
  2. The cookie is not made and then viewed in the same page, it's two different pages. The codes for making the cookie was put in the end of the first page, where I have verified that the user logged in successfully, and the codes for viewing the cookie has been put in top of the next page where I need them. $User is defined when the user has been verified to have logged in, the cookie is supposed to include the name of the player... Anything wrong with it?I didn't really get the thing with header. Do you mean I should write something like this at the top of the pagefile? <head>("location:(otherpage.php)")</head>
  3. I want to make a game, and I'm starting by doing the pages for logging in and registering players and gamecharacters.After a player has registered and has no character created yet, the player will be sent to the page for creating the character. When info on the character has been noted by the players, I need to find the username that was logged in, to see who is creating the character.The only way I can find to do this, is by using cookies.From the tutorial on cookies here, I got these codes: setcookie("User", $User, time()+3600); $User is the username that was logging in, and by now the username has been checked against the password and found to be matching.Then at the page where the character is created, I put in these codes, also found on this site: <?phpif (isset($_COOKIE["user"])) echo "Welcome " . $_COOKIE["user"] . "!<br />";else echo "Welcome guest!<br />";?><?php// Print a cookieecho $_COOKIE["User"];// A way to view all cookiesprint_r($_COOKIE);?> Now the problem is that even when I've used script to check that the player was actually able to log in, I'm not getting any cookies.All I get is "welcome guest" and some Array ( [machine-id] => (ip):(some number)) So what am i doing wrong, what is the tutorial not telling me?
×
×
  • Create New...