brandon99999 Posted April 1, 2007 Share Posted April 1, 2007 I can't seem to get the user's username displayed on top of the page when they login. Here's the code: <head> <style> body { background-color: #383838; font-family: verdana; font-size: 10px; color: #0019FF; } .mainarea { background-color: #282828; border: 1px solid #003682; text-align: center; font-size: 10px; color: #00AEFF; } .bannerarea { background-color: #0075C4; border: 1px solid #003682; text-align: center; font-size: 10px; color: #000B70; } .menulinks { text-align: left; font-size: 10px; color: #000B70; } .hole { border: 3px solid #EDDC98; } A:link{ color: #000B70; text-decoration: underline; font-size: 10px; } A:visited{ color: #00AEFF; text-decoration: underline; font-size: 10px; } A:hover{ color: #00AEFF; text-decoration: underline; font-size: 10px; } A:active{ color: #000B70; text-decoration: none; font-size: 10px; } input{ background-color: #006AFF; border: 1px solid #003682; color: #000B70; text-decoration: none; font-size: 10px; } </style> </head> <body> <table border='0' class='mainarea' width='900' height='1' align='center'> <tr> <td valign='top'> <table border='0' width='100%' height='25' align='center'> <tr> <td width='100%' class='bannerarea'> Logged in as <?php echo $username ?> . </td> </tr> </table> <table border='0' width='100%' height='120' align='center'> <tr> <td width='15%' class='bannerarea' valign='top'> <MARQUEE direction='down' height='120' onmouseover="this.stop();" onmouseout="this.start();"> Construction is underway.<br>Layout by desithugg. </MARQUEE> </td> <td class='bannerarea' valign='top'> <img src='tpfbanner.png'> </td> <td width='15%' class='bannerarea' valign='top'> Logged in as <?php echo $_POST["username"]; ?>. <br>Money <br>New Pms<br> Roster <br> PokeDex: 106/386 <br> Other: 1/1 <table width='100%' class='mainarea'> <tr><td class='bannerarea'>1</td><td class='bannerarea'>2</td><td class='bannerarea'>3</td></tr> <tr><td class='bannerarea'>4</td><td class='bannerarea'>5</td><td class='bannerarea'>6</td></tr> </table> </td> </tr> </table> <table border='0' width='100%' height='1' align='center'> <tr> <td width='15%' class='bannerarea' valign='top'> <table width='100%'> <tr><td class='mainarea'>General</td></tr> <tr><td class='menulinks'> <a href='/rpg.php'>Home</a><br> <a href='/promo.php'>Promo</a><br> <a href='/profile.php'>My Profile</a><br> <a href='http://www.freeforums.in/phpbb/viewtopic.php?t=45&mforum=pokefrontierrpg'>Forums</a><br> <a href='logout.php'>Log Out</a><br> </td></tr> <tr><td class='mainarea'>Top Affiliates</td></tr> <tr><td class='menulinks'> <a href='http://tpparpg.com'>TPPA-RPG</a><br> <a href='http://tpfrpg.eeveeshq.com'>PCA-RPG</a><br> <a href='http://pokemondoa.mmogamez.com/index.php?option=com_content&task=view&id=13&Itemid=26'>PDoA-RPG</a><br> </td></tr> </table> </td> <td class='bannerarea' valign='top'> <?php $action = $_GET['do']; $error = $_GET['error']; if($action == "") { $action = "news"; } if($error != "") { echo"<b>$error</b>"; } $action2 = "pages/$action.php"; if (file_exists($action2)) { include("$action2"); } else { echo"<center><b>Page not found.</b></center>"; } ?> </td> <td width='15%' class='bannerarea' valign='top'> <table width='100%'> <tr><td class='mainarea'>Interact</td></tr> <tr><td class='menulinks'> <a href='/traveling.php'>Travel</a><br> <a href='/battleplaza.php'>Battle Plaza</a><br> <a href='/tradingarena.php'>Trading Arena</a><br> <a href='/gamecorner.php'>Game Corner</a><br> </td></tr> <tr><td class='mainarea'>Normal Affiliates</td></tr> <tr><td class='menulinks'> Coming soon! </td></tr> </table> </td> </tr> </table> <table border='0' width='100%' height='25' align='center'> <tr> <td width='100%' class='bannerarea'> The Pokémon Frontier (TPF) is (©) copyright (©) 2007 to JoJo, Brandon and Dark Nonique. All rights Reserved.<br> Pokémon © 1995 - 2006 Nintendo/Creatures Inc./Game Freak Inc. All Rights Reserved.<br> The Pokémon Frontier (TPF) is in no way affiliated with any company that owns rights to Pokémon. <br><b>Layout done by <a href='mailto: [email protected], [email protected]'>Desithugg</a> of <a href='http://tpfrpg.eeveeshq.com'>PCA</a>.</b> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> ?> Where it says Logged in as, that's where I want theeit named to be displayed. Can somebody help me please? Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/ Share on other sites More sharing options...
MadTechie Posted April 1, 2007 Share Posted April 1, 2007 Please use the code tags, also how are they loggin in ? need more info Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219233 Share on other sites More sharing options...
brandon99999 Posted April 1, 2007 Author Share Posted April 1, 2007 Oh sorry. They logg in using Cookies if that's what you mean. Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219235 Share on other sites More sharing options...
MadTechie Posted April 1, 2007 Share Posted April 1, 2007 use echo $_cookie['username']; Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219238 Share on other sites More sharing options...
brandon99999 Posted April 1, 2007 Author Share Posted April 1, 2007 use echo $_cookie['username']; k, so it'll be like this: Logged in as<?php echo $_COOKIE['username']; ?> Wait, it doesn't work or did I make the code wrong? Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219242 Share on other sites More sharing options...
MadTechie Posted April 1, 2007 Share Posted April 1, 2007 Correct Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219246 Share on other sites More sharing options...
brandon99999 Posted April 1, 2007 Author Share Posted April 1, 2007 All man... It doesn't work. I don't know what's wrong with it. Does anybody know what's wrong with it? Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219247 Share on other sites More sharing options...
Barand Posted April 1, 2007 Share Posted April 1, 2007 It could be the code where you set the cookie that's wrong. Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219254 Share on other sites More sharing options...
brandon99999 Posted April 1, 2007 Author Share Posted April 1, 2007 It could be the code where you set the cookie that's wrong. Oh, well I dunno where that code is cause it might be in my Login code. Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219259 Share on other sites More sharing options...
Barand Posted April 1, 2007 Share Posted April 1, 2007 When you find it, check the cookie name is "username" Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219275 Share on other sites More sharing options...
brandon99999 Posted April 1, 2007 Author Share Posted April 1, 2007 This? $hour = time() + 3600; setcookie(ID_my_site, $_POST['username'], $hour); setcookie(Key_my_site, $_POST['pass'], $hour); Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219277 Share on other sites More sharing options...
Barand Posted April 1, 2007 Share Posted April 1, 2007 So you need to echo 'Logged in as ' . $_COOKIE[iD_my_site]; Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219279 Share on other sites More sharing options...
brandon99999 Posted April 1, 2007 Author Share Posted April 1, 2007 Yes!!!!! Yay!! Woot! lol Thank you so much it works now. Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219282 Share on other sites More sharing options...
Barand Posted April 1, 2007 Share Posted April 1, 2007 I take it that's a "SOLVED" Link to comment https://forums.phpfreaks.com/topic/45163-solved-this-is-hard/#findComment-219283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.