Jump to content

[SOLVED] More Help Please (Names)


Stotty

Recommended Posts

Right after being helped Yesterday with Custom Forums

 

http://phpboard.comze.com/index.php

 

Theres my link atm

 

Im trying to get on index saying Logged In : Username EG

 

Logged In : Stotty

Logout

 

But

 

$sql = "SELECT playername FROM km_users WHERE ID = '{$_GET['ID']}'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
print $row['playername'];

 

Wont Work for some reason this is my index Layout

 


<?php
include "connect.php";
session_start();
?>
<center>
<html>
<head>
<title>punMM</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
</html>
<?php
if (isset($_SESSION['player'])) 
{
  $playername=$_SESSION['player'];
  $getuser="SELECT * from km_users where playername='$playername'";
  $getuser2=mysql_query($getuser) or die("Could not get user info");
  $getuser3=mysql_fetch_array($getuser2);
  $thedate=date("U");
  $checktime=$thedate-200;
  $uprecords="Update km_users set lasttime='$thedate' where ID='$getuser3[iD]'";
  mysql_query($uprecords) or die("Could not update records");
  if($getuser3[tsgone]<$checktime)
  {
    $updatetime="Update km_users set tsgone='$thedate', oldtime='$getuser3[tsgone]' where ID='$getuser3[iD]'";
    mysql_query($updatetime) or die("Could not update time");
  }
  print "<center><table class='maintable'><tr class='headline'><td colspan='2' width=75%>Forum name</td><td>Topics</td><td>Posts</td><td>Last Post</td></tr>";
  $getforums="SELECT * from km_forums order by forumorder ASC";
  $getforums2=mysql_query($getforums) or die("Could not get forums");
  while($getforums3=mysql_fetch_array($getforums2))
  {
     print "<tr class='mainrow'><td width=3%>";

     if($getforums3['realtimelastpost']>$getuser3['oldtime'])
     {
       print "<img src='images/postforum.jpg' border='0'>";
     }
     else
     {
       print "<img src='images/postforum.gif' border='0'>";
     }

     print "</td><td><A href='forum.php?ID=$getforums3[forumID]'>$getforums3[forumname]</a><br>$getforums3[descrip]</td><td>$getforums3[numtopics]</td><td>$getforums3[numposts]</td><td>$getforums3[timelastpost]<br>by <b>$getforums3[lastposter]</b></td></tr>";
  }
  print "</table>";


}
else
{ 
    print "<table class='maintable'>";
    print "<tr class='headline'><td><center>Not logged in</center></td></tr>";
    print "<tr class='mainrow'><td>You are not logged in, please <A href='login.php'>Login</a>";
    print "</td></tr></table>";
  

}
?>
     

 

PHP My Admin Layout

 

CREATE TABLE `km_users` (
  `ID` bigint(21) NOT NULL auto_increment,
  `status` int(11) NOT NULL default '0',
  `playername` varchar(15) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `validated` int(11) NOT NULL default '0',
  `validkey` varchar(255) NOT NULL default '',
  `tsgone` bigint(20) NOT NULL,
  `oldtime` bigint(20) NOT NULL default '0',
  `lasttime` bigint(20) NOT NULL default '0',
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

 

 

Thanks in Advanced

 

Im Very Greatfull

 

I was trying this all Night  >:(

Link to comment
https://forums.phpfreaks.com/topic/138984-solved-more-help-please-names/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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