Jump to content

wro

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by wro

  1. Also attempted using named sessions, but it didn't work. Is there a way to check the content frame to see if a session exists and relaying the info to the menu frame so that sessions aren't required in the menu frame. Thanks again
  2. Thank you, it does output correctly, but gives the following for either logged in or out: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent I'm sure it's something simple, I'll be the first to admit I'm still very new (the session_start is directly below the opening php tag with nothing before it.)
  3. Hello, I am using two frames, one for navigation and the other for content. The navigation will display news and other information if there is not a session set, the content, once logged in will set the session then reload the menu frame, however the menu frame isn't picking up on this and continues to display the news and other info. edit: Even if I manually reload the navigation menu frame, it doesn't detect the session =( Menu page. <php include 'connect.php'; ?> <?php if (isset($_SESSION['player'])) { echo "<a href=\"overview.php\" target=\"content\"><p align=\"center\">Overview</p></a>"; echo "<a href=\"town.php\" align=\"center\" target=\"content\"><p align=\"center\">Town</p></a>"; echo "<a href=\"charsheet.php\" align=\"center\" target=\"content\"><p align=\"center\">Character Sheet</p></a>"; echo "<a href=\"skills.php\" align=\"center\" target=\"content\"><p align=\"center\">Skills</p></a>"; echo "<a href=\"market.php\" align=\"center\" target=\"content\"><p align=\"center\">Market</p></a>"; echo "<a href=\"guild.php\" target=\"content\"><p align=\"center\">Guild Hall</p></a>"; echo "<p align=\"center\"><img src=\"images/standard.jpeg\" align=\"middle\"></p>"; echo "<p align=\"center\">HP: xxx/xxx</p>"; echo "<p align=\"center\">IP: xxx/xxx</p>"; } else { echo "<h2>News:</h2>"; echo "<p>Frame and menu added 05-26-2010</p>"; echo "<p>Registration live 05-18-2010</p>"; } ?> Snippet from the authentication page. if($result2) { session_start(); $_SESSION['player']=$player; print "logged in successfully<br><br>"; print "<A href='content.php'>Play!</a>"; print("<script language ='javasript'>top.menu.locatin.reload();</script>"); }
  4. Thanks to you all, knew it was something simple (need to stop doing this so late at night =P)
  5. Hello, tinkering around with my code (which worked) and I've attempted to use frames and the php is having errors. I've tried including html tags, using echo all through (escaping quotes) etc, and I just can't figure it out =/ It returns Parse error: syntax error, unexpected '<' in xxxxxxxxxxxxx/content.php on line 19 (line 19 is print "it worked"..ironically) Many thanks in advance. <?php //INDEX session_start(); include 'connect.php'; ?> <center> <h1>lets hope it connects..</h1> </center><br><br> <link rel="stylesheet" href="style.css" type="text/css"> <?php if (isset($_SESSION['player'])) { $player=$_SESSION['player']; $userstats="SELECT * from database where playername='$player'"; $userstats2=mysql_query($userstats) or die("Could not get user stats"); $userstats3=mysql_fetch_array($userstats2); print "it worked =)";<br> <a href="fight.php">Kill A Creature!</a><br> if($userstats3[dead]=='Yes') { print "You're dead.<br>"; } } else { print "Sorry, not logged in please <A href='login.php' target="content.php">Login</a><br>"; } ?>
  6. Thank you so much =D
  7. Hello all, new to the site and new(ish) to php. I'm attempting to get a registration going for a php game, but it's returning an error. It's returning "could not register" Thanks in advance to any ideas =D $password=md5($password); $date=round(date("U")/1000); srand($date); $thekey=rand(1,100000000); $thekey=md5($thekey); $SQL = "INSERT into wr_users(playername, password, email, str, end, int, luck, dead, turns, gold, validated, validkey) VALUES ('$player', '$password', '$email', '3', '3', '3', '3', '0', '20', '12', '0', '$thekey')"; mysql_query($SQL) or die("could not register"); [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.