Jump to content

dean7

Members
  • Posts

    309
  • Joined

  • Last visited

Posts posted by dean7

  1. Hi all, on my website i have userlevels witch people with a certain userlevel can see certain things but on my code it says there is an error

     

    <?
    if($logged[level] ==owner | $logged[level] == head mod | $logged[level] == admin | $logged[level] ==mod)
    {
    // More code but not needed i think
    ?>
    

     

    Im getting a error saying:

     

    Parse error: syntax error, unexpected T_STRING in /home/a7502957/public_html/main.php on line 64

     

    Thanks for your help.

  2. Hi all, On some of my webpages of my website im getting a error saying:

    Notice: Use of undefined constant a7502957_main - assumed 'a7502957_main' in /home/a7502957/public_html/config.php on line 4

     

    This is my code:

    <?
       ob_start(); // allows you to use cookies
       $conn = mysql_connect("**********","a7502957_main1","************");
       mysql_select_db(a7502957_main);
       $logged = MYSQL_QUERY("SELECT * from users WHERE id='$_COOKIE[id]'");
       $logged = mysql_fetch_array($logged);
    ?>
    

     

    Does anyone know why im getting them errors?

     

    Thanks for you help.

  3. hi all i have a forum for on my website but there a problem witch i carnt fix...

     

    <?
    session_start();
    include "functions.php";
    $username=$logged['username'];
    include "config.php";
    include"include/smile.php";
    include"style.css";
    ?>
    
    <?
    $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
    $level=$fetch->level;
    if ($fetch->fban == "1"){
    
    echo "<b><font color=white>You Have Been Banned From Using The Forums.";
    die();
    }
    
    $forum=$_GET['forum'];
    
    if ($forum == "Crew" && $fetch->crew != "0"){
    $crew="1";
    
    }
    
    
    $forum_look=$_GET['forum_look'];
    echo "<link rel=stylesheet href=includes/in.css type=text/css>";
    
    
    
    
    
    $forum_count = 30;
    
    function index_navigation($index, $count, $num) {
    $forum = $_GET['forum'];
    if ($index != 0) {
    	print "<a href=\"left.php?forum=".$forum."&forum_look=" . ($index - $count) . "\"><b>Previous</a> ";
    }
    if ($num == $count) {
    	print " <a href=\"left.php?forum=".$forum."&forum_look=" . ($index + $count) . "\"><b>Next</a>";
    }
    
    
    }
    if (! isset($forum_look) ) {
    			$forum_look = 0;
    		}
    ?><title><border="2"  cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">Topics</title><body bgcolor="#000000" background="backg.gif">
    
    
    <p align="center"><a href="topic.php?forum=<? echo "$forum"; ?>" target="frameright"><strong>Create New Topic</strong></font> </a></font> <b><font color=white>| <a href="left.php?forum=main"><b>Refresh</a></p>
    <table width="276" border="1" cellspacing="0" cellpadding="4" bordercolor="#666666" bgcolor="#000000">
      <tr><td height="29" colspan="5" background="includes/grad.gif" bordercolor=""><p align="center"><font size="2"><strong><font color="#FFFFFF" size="1">Topics
      </font></strong></font></p>
      </td>
      </tr>
    
    
    
    <font color='white'><b><?
    if ($crew == "1"){
    $query="SELECT * FROM `topics` WHERE `forum`='$forum' AND crew='$fetch->crew' ORDER BY `lastreply` DESC LIMIT $forum_look, $forum_count";
    }else{
    $query="SELECT * FROM `topics` WHERE `forum`='$forum' ORDER BY `lastreply` DESC LIMIT $forum_look, $forum_count";
    }
    
    
    $query=mysql_query("$query");
    $num=mysql_num_rows($query);
    $col="0";
    while($fo=mysql_fetch_object($query)){
    if ($col=="0"){ $td="#000000"; $col="1"; }else{ $td="#000000"; $col="0"; }
    
    $hehe=mysql_num_rows(mysql_query("SELECT * FROM replys WHERE idto='$fo->id'"));
    
    
    
    
    
    
    if ($fetch->level == "member" || $fetch->level == "admin" || $fetch->level == "headmod" || $fetch->level == "mod" || strtolower($by) == strtolower($username) || $crew == "1" && $owner != "0"){
    echo "<tr bgcolor=$td><td width='92%'>"; if ($fo->important == "1" ){ echo"<font color='white'><b><u>Important:</u> <a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a></font>"; } if ($fo->sticky == "1" ){ echo"<font color='white'><b>Sticky: </b></font>"; }  if ($fo->sticky == "1" ) {
    echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a>  </font>"; } if ($fo->locked == "1" ){ echo"<font color='white'><b> (locked)</b></font>"; }
    elseif ($fo->sticky == "1" && $fo->locked == "1") {
    echo "<b>Sticky: </b></font>"; }
    elseif ($fo->sticky == "0" && $fo->important == "0" ) {
    echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'>$fo->title</a>  </font></td>"; }
    if ($fo->locked == "1" ) {
    echo "<td width=1><a title='Unlock'  href='left.php?unlock=$fo->id&forum=$forum'><font color=3399cc>[uL]</font></a></td>"; } elseif($fo->locked == "0" ) {
    echo "<td width=1><a title='Lock' href='left.php?lock=$fo->id&forum=$forum'><font color=3399cc>[L]</font></a></td>"; }
    if ($fo->important == "0" && $fo->sticky == "1" ) { 
    echo "<td width=1><a title='Unsticky'  href='left.php?unstick=$fo->id&forum=$forum'><font color=3399cc>[uS]</font></a></td>"; }
    if ($fo->important == "1" && $fo->sticky == "0" ) {
    echo "<td width=1><a title='Unimportant'  href='left.php?unimportant=$fo->id&forum=$forum'><font color=3399cc>[uI]</font></a></td>"; } if ($fo->sticky == "1" ) {
    echo "<td width=1><a title='Important' href='left.php?important=$fo->id&forum=$forum'><font color=3399cc>[i]</font></a></td>"; }
    elseif ($fo->sticky == "0") {
    echo "<td width=1><a title='Sticky'  href='left.php?stick=$fo->id&forum=$forum'><font color=3399cc>[s]</font></a></td>"; }
    echo "<td width=1><a title='Delete' href='left.php?clean=$fo->id&forum=$forum'><font color=3399cc>[D]</font></a></td>";
    }else{
    echo "<tr  bgcolor=$td><td width='92%'>"; if ($fo->important == "1" ){ echo"<font color='white'><b><u>Important:</u> <a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a></font>"; } if ($fo->sticky == "1" ){ echo"<font color='white'><b>Sticky: </b></font>"; } 
    if ($fo->sticky == "1" ){ 
    echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a></font>"; } if ($fo->locked == "1" ){ echo"<font color='white'><b> (locked)</b></font></td>"; }
    elseif ($fo->sticky == "0" ){ 
    echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'>$fo->title</a></td></font>"; }
    }
    
    
    
    
    
    
    }
    
    
    
    if($_GET[lock]) {
    $lock = $_GET[lock];
    if($fetch->level == "member") { die('You cannot lock this topic'); }
    $locked =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$lock'"));
    
    $check1=mysql_query("SELECT * FROM topics WHERE id='$lock'");
    $chech=mysql_fetch_object($check1);
    
    
    if($level > 0 || $lock != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("UPDATE topics SET locked='1' WHERE id='$lock' AND crew = '$fetch->crew' ");
    
    }else{
    mysql_query("UPDATE topics SET locked='1' WHERE id='$lock'");
    
    }
    
    echo "Locked";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    if($_GET[unlock]) {
    $lock = $_GET[unlock];
    if($fetch->level == "member") { die('You cannot unlock this topic'); }
    $locked =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$lock'"));
    
    $check1=mysql_query("SELECT * FROM topics WHERE id='$lock'");
    $chech=mysql_fetch_object($check1);
    
    
    if($level > 0 || $lock != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("UPDATE topics SET locked='0' WHERE id='$lock' AND crew = '$fetch->crew' ");
    mysql_query("UPDATE topics SET title='$new_tit2' WHERE id='$lock'");
    
    }else{
    mysql_query("UPDATE topics SET locked='0' WHERE id='$lock'");
    }
    
    echo "<font color=white>Unlocked";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    if($_GET[important]) {
    if($fetch->level == "member") { die('<font coldor=white>You cannot make this topic Important'); }
    $important = $_GET[important];
    $check1=mysql_query("SELECT * FROM topics WHERE id='$important'");
    $chech=mysql_fetch_object($check1);
    $new_tit=" <b>$chech->title</b>";
    $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$important'"));
    
    if($level > 0 || $important != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("UPDATE topics SET important='1' && sticky='0', lastreply='99999999999999999' WHERE id='$important' AND crew = '$fetch->crew'");
    } else {
    mysql_query("UPDATE topics SET important='1' && sticky='0', lastreply='99999999999999999' WHERE id='$important'");
    }
    
    echo "<font color=white>Made Important!";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    if($_GET[unimportant]) {
    if($fetch->level == "member") { die('<font color=white>You cannot make this topic Unimportant'); }
    $important = $_GET[unimportant];
    $check1=mysql_query("SELECT * FROM topics WHERE id='$important'");
    $chech=mysql_fetch_object($check1);
    $new_tit="<b>$chech->title</b>";
    $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$important'"));
    
    if($level > 0 || $important != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("UPDATE topics SET important='0', lastreply='1290232642' WHERE id='$important' AND crew = '$fetch->crew'");
    } else {
    mysql_query("UPDATE topics SET important='0', lastreply='1290232642' WHERE id='$important'");
    }
    
    echo "<font color=white>Made Unimportant";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    if($_GET[stick]) {
    if($fetch->level == "member") { die('<font coldor=white>You cannot sticky this topic'); }
    $stick = $_GET[stick];
    $check1=mysql_query("SELECT * FROM topics WHERE id='$stick'");
    $chech=mysql_fetch_object($check1);
    $new_tit=" <b>$chech->title</b>";
    $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$stick'"));
    
    if($level > 0 || $stick != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("UPDATE topics SET sticky='1', lastreply='999999999999999' WHERE id='$stick' AND crew = '$fetch->crew'");
    } else {
    mysql_query("UPDATE topics SET sticky='1', lastreply='999999999999999' WHERE id='$stick'");
    }
    
    echo "<font color=white>Stickied";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    if($_GET[unstick]) {
    if($fetch->level == "member") { die('<font color=white>You cannot unstick this topic'); }
    $stick = $_GET[unstick];
    $check1=mysql_query("SELECT * FROM topics WHERE id='$stick'");
    $chech=mysql_fetch_object($check1);
    $new_tit="<b>$chech->title</b>";
    $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$stick'"));
    
    if($level > 0 || $stick != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("UPDATE topics SET sticky='0', lastreply='1290232641' WHERE id='$stick' AND crew = '$fetch->crew'");
    } else {
    mysql_query("UPDATE topics SET sticky='0', lastreply='1290232641' WHERE id='$stick'");
    }
    
    echo "<font color=white>Unstickied";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    if($_GET[clean]) {
    if($fetch->level == "member") { die('<font color=white>You cannot delete this topic'); }
    $clean = $_GET[clean];
    $cc=mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$clean'"));
    
    if($level > 0 || $clean != "0" ){
    if ($forum == "Crew" && $crew == "1"){
    mysql_query("DELETE FROM topics WHERE id='$clean' AND crew='$fetch->crew'");
    mysql_query("DELETE FROM replys WHERE idto='$clean' AND crew='$fetch->crew'");
    }else{
    mysql_query("DELETE FROM topics WHERE id='$clean'");
    mysql_query("DELETE FROM replys WHERE idto='$clean'");
    }
    
    echo "<font color=white>Cleaned";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>";
    }
    }
    
    ?></b></font>
    </table><br>
    
    
    <?php
    index_navigation($forum_look, $forum_count, $num);
    ?>
    

    Sorry about the length of the code but i though it might be needed.

     

    When a topic isnt sticky or locked or important it doesnt show the topic but when its sticky it shows it. If you lock the topic it just shows that the topic is locked but still doesnt show the topic. But if your a user with the level of member you can see it..

     

    Carnt see why its not showing..

     

    Anyone know why?

    Thanks for you help.

     

  4. Hi all, Ive got a news script for my website witch can show updates etc

     

    main.php

    <?php
    session_start();
    include "config.php";  include "includes/functions.php";
    ?>
    
    <html>
    <head>
    <link rel=stylesheet href=includes/in.css type=text/css>
    <title>Updates</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    
    <body>
    
    <table class="Main" width="50%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#000000">
    
    <tr><td background="includes/grad.gif" height="39" colspan="2" class="TableHeading"><b><u>Game updates</u></b></td>
    </tr>
    
    <?
    $select_updates=mysql_query("SELECT * FROM updates ORDER BY id DESC");
    while($the=mysql_fetch_object($select_updates)){
    ?>
    
    <tr><td background="includes/grad.jpg" class='TableSub' height=20 width=70%><center><b>By: <? echo "<A href='profile.php?viewuser=$the->username'>$the->username</a>"; ?> On: <? echo "$the->time"; ?></b></center></td></tr>
    <tr><td class='TableArea' colspan=2 width=30%><? echo "$the->update<p>"; ?></td></tr>
    
    <?
    }
    ?>
    
    </table>
    
    <br>
    
    <?php if ($fetch->level == "owner"){ 
    if (strip_tags($_POST['submit']) && (strip_tags($_POST['update'] != ""))){
    $update=strip_tags($_POST['update']);
    $date = gmdate('Y-m-d h:i:s');
    mysql_query("INSERT INTO `updates` ( `id` , `username` , `time` , `update` ) 
    VALUES (
    '', '$username', '$date', '$update'
    )");
    echo "Update has been added";
    }
    }
    ?>
    
    <form name="form1" method="post" action="">
      <table width="450x" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#000000" class="Main">
        <tr><td class="TableHeading">Add an update</td></tr>
        <tr><td class="TableArea" align="center">Add an update:
          <textarea name="update" cols="80" rows="5" id="update"></textarea>
          <input name="submit" type="submit" id="submit" value="Add update"><br>
        </td></tr>
      </table>
    </form>
    <p> </p>
    <table align="center" width="482" height="47" border="2" bgcolor="#000000">
      <tr><td width="470">
      <center>
        <p><b><img src="Images/question mark.jpg"></b><br>
          <strong><font color="#CCCCCC">Info about website be posted here soon </font></strong>    </p>
        </center>
    
      </table>
    </tr></td>
    </body>
    </html>
    

     

    But were it is ment to insert into the database its not.. Any one know why?

     

    Thanks

  5. hi, for my website i have somthing like a news script so users can see whats new etc... but there is somthing wrong with it..

     

    <html>
    <head>
    <link rel=stylesheet href=../../Backups/includes/in.css type=text/css>
    <title>GG News</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    .style1 {color: #FFFFFF}
    body {
    
    }
    .style3 {color: #FFFFFF; font-weight: bold; }
    -->
    </style>
    </head>
    
    <body>
    <table class=thinline width="80%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor=black>
      <tr>
        <td height="31" background="includes/grad.gif"><center class=bold>
          <span class="style1">Latest News      </span>
        </center></td>
      </tr>
    
      <tr>
        <td bgcolor="#000000">
    <?php $select_updates=mysql_query("SELECT * FROM updates ORDER BY id DESC");
    while($the=mysql_fetch_object($select_updates)){
    
    echo "$the->update<p>";
    
    echo "Added by: : <A href='profile.php?viewuser=$the->username'>$the->username</a> Date: : $the->time";
    echo "<br>";
    }
    ?>	</td>
      </tr>
    </table>
    <br>
    <br>
    <?php if ($fetch->userlevel == "owner"){ 
    if (strip_tags($_POST['submit']) && (strip_tags($_POST['update'] != "0"))){
    $update=strip_tags($_POST['update']);
    $date = gmdate('Y-m-d h:i:s');
    mysql_query("INSERT INTO `updates` ( `id` , `username` , `time` , `update` ) 
    VALUES (
    '', '$username', '$date', '$update'
    )");
    echo "<font color=white><b>News Added</font>";
    }
    
    
    ?>
    <form name="form1" method="post" action="">
      <table width="25%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#000000">
        <tr> 
          <td><table width="89%" border="0" cellspacing="3" cellpadding="0">
              <tr>
                <td height=29 bordercolor="#000000" background="includes/grad.gif" bgcolor="#000000"><div align="center"><span class="style3">Add News! </span></div></td>
              </tr>
              <tr> 
                <td bordercolor="#000000" bgcolor="#000000"> <div align="center"> 
                    <textarea size="15" name="update" cols="80" rows="5" bgcolor="black" id="update"></textarea> ~~~This bit not showing
                  </div></td>
              </tr>
              <tr> 
                <td bordercolor="#000000" bgcolor="#000000"><div align="center">
                  <input name="submit" type="submit" id="submit" class="button" value="Add update">
                </div></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </form>
    <? } ?><p>
    <?php include_once"includes/footer.php"; ?>
    
    
    </body>
    </html>
    

     

    When i go to add news it doesnt show the add news box like it should can anyone see why?

     

    Thanks :)

  6. Hi all i have a ban script for my website but there is some kind of problem, here the script

     

    <?php
    include('config.php');
    include('style.css');
    include('functions.php');
    session_start();
    $username=$_SESSION['username'];
    $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
    $level=$fetch->level;
    
    if($level > "owner"){
    
    $ban=$_POST['ban_username'];
    $time=$_POST['time'];
    $reason=$_POST['reason'];
    $type=$ban;
    
    if(!$ban){
    }else{
    mysql_query("UPDATE users SET status='Banned' WHERE username='$ban'");
    
    mysql_query("INSERT INTO `ban` (`id`, `username`, `by`, `type`, `reason`, `length`) VALUES ('', '$ban', '$username', '$type', '$reason', '$time')");
    
    mysql_query("INSERT INTO `log` ( `id` , `by` , `action` , `level` ) 
    VALUES ('', '$username', 'Banned $ban_username for reason $ban_reason', '$userlevel')");
    
    echo "You banned $ban.";
    echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=ban.php\">";
    }
    }
    
    ?>
    
    <style type="text/css">
    <!--
    body,td,th {
    color: #990000;
    }
    body {
    background-color: #999999;
    }
    -->
    </style><form name="form1" method="post" action="">
      <table width="67%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="<?php echo "$td_bg"; ?>">
        <tr> 
          <td height=22 background="<?php echo"$gradient"; ?>"><center class="TableHeading">
              <strong>Ban a user</strong> </center></td>
        </tr>
        <tr> 
          <td><table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr> 
                <td width="50%">Username</td>
                <td width="50%"><input name="ban_username" type="text" id="ban_username"></td>
              </tr>
              <tr> 
                <td>Length(Levae blank for permanent ban).</td>
                <td><input name="time" type="text" id="time">
                  Hours</td>
              </tr>
              <tr> 
                <td>Reason</td>
                <td><textarea name="ban_reason" cols="40" rows="7" id="ban_reason"></textarea></td>
              </tr>
              <tr> 
                <td> </td>
                <td><input name="Ban" type="submit" id="Ban" value="Ban this user"></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </form>
    <p><br>
      <br>
    </p>
    </body>
    </html>
    

     

    When you put the in info in then click 'ban this user' nothing happends anyone know why?

     

    Thanks :)

  7. Use sessions to keep track of a users session. There are plenty of tutorials around on building a login system, one of these should get you started.

    But wont the mean writing all my other scripts agian?

  8. Hi all, Ive got a online page so you can veiw what users are online but there is a problem with it but see why :S

     

    <?
    session_start();
    include ("functions.php");
    include ("config.php"); 
    include ("style.css");
    include ("makelogin.php");
    
    $username=$logged['username'];
    
    $total_regged=mysql_num_rows(mysql_query("SELECT * FROM users"));
    $admins=mysql_num_rows(mysql_query("SELECT * FROM users WHERE level='member'"));
    $most=$iti->online;
    ?>
    
    <html><head><link rel="stylesheet" href="../../../../../../DOCUME~1/New/LOCALS~1/Temp/Rar$DI49.9672/includes/in.css" type="text/css">
    <script type="text/javascript" src="../../../../../../DOCUME~1/New/LOCALS~1/Temp/Rar$DI49.9672/includes/overlib.js"></script><style type="text/css">
    <!--
    .style3 {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 10px;
    }
    .style21 {font-size: 10px; color: #FFFFFF;}
    .style24 {
    font-size: 10px;
    font-weight: bold;
    }
    .style8 {color: #FFFFFF}
    .style5 {color: #FF9900}
    .style6 {color: #FFFF00}
    body {
    
    }
    .style1 {color: #339900}
    .style18 {color: #999999}
    .style26 {	color: orange;
    font-weight: bold;
    font-size: 10px;
    }
    -->
    </style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Players Online</title></head><div id=overDiv style="position:absolute; visibility:hidden; z-index:1000;"></div>
    
    </head>
    
    <body>
    <table width="87%" border="0" align="center" cellpadding="0" cellspacing="3">
      <tr> 
        <td height="168"><table class="thinline" width=100% border="1" cellpadding="2" cellspacing="0" bordercolor=black>
            <tr> 
              <td height="28" colspan="2" bordercolor="#000000" background="includes/grad.gif" bgcolor="#000000"><div align="center"><span class="style3">Players Online </span></div></td>
            </tr>
            <tr> 
              <td width="2%" bordercolor="#000000" bgcolor="#000000"> </td>
              <td bordercolor="#000000" bgcolor="#000000"><b>
                <font color='#3399cc'><?
    			$timenow=time();
    $select = mysql_query("SELECT * FROM users WHERE online > '$timenow' ORDER by 'level' DESC");
    $num = mysql_num_rows($select);
    while ($i = mysql_fetch_object($select)){
    if ($i->crew == "0"){
    $crew="None";
    }else{
    $crew=$i->crew;
    }
    if ($i->last_oc > time()){
    $oc="No";
    }else{
    $oc="Yes";
    }
    
    
    if($i->level=="owner"){
    $echo = "<font color=orange>$i->username</font>";
    }elseif ($i->level=="headmod"){
    $echo = "<font color=yellow>$i->username</font>";
    }elseif ($i->level=="mod"){
    $echo = "<b><font color='pink'>$i->username</font></b>";
    }else{
    $echo = "$i->username";
    }
    
    
    
    
    echo "<a onmouseover=\"return overlib('Ready for an OC: $oc<br>Rank: $i->rank<br>Crew: $crew', STICKY, CAPTION, 'User: $i->username', CENTER);\" onmouseout=\"nd();\" href='profile.php?viewuser=$i->username' style=\"\"> $echo </a>,";
    } ?></font>
              </b></td>
            </tr>
            <tr>
              <td height="27" bordercolor="#000000" bgcolor="#000000"> </td>
              <td height="27" bordercolor="#000000" bgcolor="#000000"><span class="style3">Total Number Of Payers Online: <font color="#ffffff"><?php echo "$num"; ?></font></span></td>
            </tr>
            <tr>
              <td bordercolor="#000000" bgcolor="#000000"> </td>
              <td bordercolor="#000000" bgcolor="#000000"> </td>
            </tr>
            <tr>
              <td bordercolor="#000000" bgcolor="#000000"> </td>
              <td bordercolor="#000000" bgcolor="#000000"><span class="style26">Orange<span class="style8">-</span></span><span class="style3">These are the owners, they run the 
                game and code it.</span><span class="style24"><br>
                <font color=yellow>Yellow</font><span class="style8">- These are Head Mod they help they admins run game.</span><br>
                <font color=pink>Pink</font><span class="style8">- All usernames in pink are mod's they help you with basic things, any problems please ask them before anyone else.</span><br>
                </span><span class="style8"><span></span></span><span class="style24"><br>
    
              </span></td>
            </tr>
        </table></td>
      </tr>
    </table>
    <p> </p>
    <table align="center" width="482" height="47" border="2" bgcolor="#000000">
      <tr><td width="470">
      <center>
        <p><b><img src="Images/question mark.jpg"></b><br>
            <b><font color="#CCCCCC">Here, you can find out who is online, every single player who is online at this time will show up on this page. So, you can look for which staff are on. If you are looking for a certain player, I recommend you use the search player, and see if there status is "online" on there profile.</font></b>     </p>
        </center>
    
      </table>
    </tr></td>
    </body>
    </html>
    

     

    When a user login it shows there username there but after a few minutes it goes aways while there still online, is there anyway of making there username stay there untill the do offline?

     

    Thanks

  9. Hi, ive started coding a new login and register for my website but on the register scrip i have a unexpected $end witch i dont know why.

     

    <?php
    session_start();
    include('database.php');
    // start register code. -- Line 4
    
    if (isset($_SESSION['username'])){
    header("Location: index2.php");
    exit();
    }
    
    // Define post fields into simple variables witch get inserted in to the database -- Line 11 
    $reg_username = $_POST['reg_username']; 
    $reg_password = $_POST['reg_password']; 
    
    $email = $_POST['email'];
    $email1 = $_POST['email1']; 
    $reg_username=trim($reg_username);
    $reg_password=trim($reg_password);
    // Getting the data and time the day the user registered -- Line 19
    $today = gmdate('Y-m-d h:i:s');
    // Making the Varibales stronger -- Line 21
    $reg_username = stripslashes($reg_username); 
    $email = stripslashes($email); 
    $quote = stripslashes($quote); 
    $reg_username = strip_tags($reg_username); 
    $email = strip_tags($email); 
    // Making sure no data is the same. If so echo a error -- Line 27
    if((!$reg_username) || (!$email) || (!$reg_password)){ 
    $message="Please Fill In All Fields";
    }else{
    if ($email != $email1){
    $message="Emails Dont Match, Please Try Agian";
    }elseif ($email == $email1){
    // Username only allowed to contain latters -- Line 34
    if (ereg('[^A-Za-z0-9]', $reg_username)) {  $message="Your Username Can Only Contain Letters.";
    }elseif (!ereg('[^A-Za-z0-9]', $reg_username)) { 
    // Make sure the username isnt to long or to short -- Line 37
    if (strlen($reg_username) <= 3 || strlen($reg_username) >= 40){
    $message= "Username Too Big Or Too Small.";
    }elseif (strlen($reg_username) > 3 || strlen($reg_username) < 40){
    // Check email -- Line 41
    $sql_email_check = mysql_query("SELECT email FROM users 
                WHERE email='$email' AND status='Alive'"); 
    $sql_username_check = mysql_query("SELECT username FROM users 
                WHERE username='$reg_username'"); 
    // Check email doesnt exict twice on different users -- Line 46
    $email_check = mysql_num_rows($sql_email_check); 
    $username_check = mysql_num_rows($sql_username_check); 
    // If = anything but 0 email allready in database // Line 49
    if(($email_check > 0) || ($username_check > 0)){ 
        echo "Im sorry but there has been an error please read on..<br />"; 
        if($email_check > 0){ 
            $message= "Your email address has already been used by another gangster!"; 
            unset($email); 
        } 
    if($username_check > 0){ 
            $message="Your desired username is already in use!"; 
            unset($reg_username); 
        } 
      
       
    }
    
    // Get ip // Line 64
    $ip = $_SERVER['REMOTE_ADDR'];
    // Get a random password // Line 66
    $random_password22=rand(11111,99999999);
    
    
    // Put into the database // Line 70
    
    mysql_query("INSERT INTO `users` ( `id`, `username`, `password`, `online`, `status`, `email`, `l_ip` )
    VALUES (
    '', '$reg_username', '$reg_password', '0000-00-00 00:00:00', 'Active', '$email', '$ip')");
    // Userid insert -- Line 75
    $userid = mysql_insert_id();
        
       $message= 'Account created, <a href="index.php">You may now log in.</a> '; 
    // end script -- Line 80
    ?>
    
    <html>
    <head>
    <title>Great-Gaming | Register</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="includes/in.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    <style type="text/css">
    <!--
    body {
    background-image: url(includes/bg.jpg);
    }
    .style4 {font-weight: bold}
    -->
    </style></head><html>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- ImageReady Slices (a try.psd) -->
    <table width="402" height="600" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
      <!--DWLayoutTable-->
      <tr> 
        <td width="211" height="98"> </td>
        <td width="401"> </td>
        <td width="366"> </td>
      </tr>
      <tr> 
        <td height="189"> </td>
        <td valign="top"><form name="form2" method="post" action="">
            <table width="400" height=29 border="1" cellpadding="0" cellspacing="0" class=thinline rules=none>
              <tr> 
                <td height=29 background="includes/grad.gif"><div align="center">
                  <p><b>Register</b></p>
                </div></td>
              </tr>
              <tr bgcolor=black> 
                <td height=1 colspan=3></td>
              </tr>
              <tr> 
                <td align="center" valign="top"><table width="100%"  border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td colspan="2"><div align="center"><font color=red> 
                          <? echo "$message"; ?>
                          </font></div></td>
                    </tr>
                    <tr> 
                      <td width="25%">Username:</td>
                      <td width="75%"><input name="reg_username" type="text" id="reg_username" value="" size="30" maxlength="40"></td>
                    </tr>
                    <tr> 
                      <td width="25%">Password:</td>
                      <td width="75%"><input name="reg_password" type="text" id="reg_password value="" size="30" maxlength="40"></td>
                    </tr>
                    <tr> 
                      <td>Email address:</td>
                      <td><input name="email" type="text" id="username3" value="" size="30" ></td>
                    </tr>
                    <tr> 
                      <td>Confirm email:</td>
                      <td><input name="email1" type="text" id="email" value="" size="30"></td>
                    </tr>
                    <tr> 
                      <td> </td>
                      <td><input type="submit" name="Submit" value="Register"></td>
                    </tr>
                    <tr> 
                      <td> </td>
                      <td> </td>
                    </tr>
                  </table></td>
              </tr>
            </table>
          </form></td>
        <td> </td>
      </tr>
      <tr> 
        <td height="14"></td>
        <td valign="top"><form name="form1" method="post" action="">
            <div align="center"><span class="style4"><a href="index.php">Login</a> | <a href="lost.php">Lost 
              password </a></span></div>
          </form></td>
        <td></td>
      </tr>
      <tr> 
        <td height="487"></td>
        <td> </td>
        <td></td>
      </tr>
    </table> Line 188
    

     

    The error code im gettting is

     

    Parse error: syntax error, unexpected $end in /home/a4314615/public_html/register.php on line 188

     

    Sorry about the long code but i though ill post it all, because it could help.

     

    Please help thanks

  10. Hi all, on my website on the nav i have an error witch says

     

    Parse error: syntax error, unexpected $end in /home/a7502957/public_html/nav.php on line 186

     

    My code

     

    <div id="masterdiv">
    
    <?php
    if($loggged[username] && $logged[level]==owner)
    {
    echo "<div class='menutitle' onclick='SwitchMenu('sub1')'>Staff Panel</div>
    <span class='submenu' id='sub1'>
    - <a href='../admin/index.php' target='mainFrame'>Admin</a><br>
                     - <a href='headmod.php' target='mainFrame'>Headmod</a><br>
    	- <a href='mod.php' target='mainFame'>Mod</a><br>
    	- <a href='owner.php' target='mainFrame'>Owner</a>
           </span>";
    }else{
    echo ' ';
    ?>
    
    <div class="menutitle" onclick="SwitchMenu('sub2')">Genral</div>
    <span class="submenu" id="sub2">
    	- <a href="index2.php" target="mainFrame">News</a><br>
    	- <a href="find.php" target="mainFrame">Find User</a><br>
    	- <a href="online.php" target="mainFrame">Online Users</a><br>
                    - <a href="members.php" target="mainFrame">All Members</a><br>
    </span>
    
    <div class="menutitle" onclick="SwitchMenu('sub3')">Communiation</div>
    <span class="submenu" id="sub3">
    	- <a href="messages.php?inbox.php" target="mainFrame">Inbox</a><br>
                    - <a href="forum.php" target="mainFrame">Forum</a><br>
                    - <a href="chat.php" target="mainFrame">Chat</a><br>
    </span>
    
    <div class="menutitle" onclick="SwitchMenu('sub4')">User Cp</div>
    <span class="submenu" id="sub4">
    	- <a href="members.php?user=$id" target="mainFrame">Veiw Profile</a><br>
    	- <a href="editprofile.php" target="mainFrame">Edit Profile</a><br>
    	- <a href="allstats.php" target="mainFrame">My Stats</a><br>
    </span>
    
    <div class="menutitle" onclick="SwitchMenu('sub5')">Crew</div>
    <span class="submenu" id="sub5">
    	- <a href="makecrew.php" target="mainFrame">Make A Crew</a><br>
    	- <a href="allcrews.php" target="mainFrame">All Crews</a><br>
    	- <a href="crewmanage.php" target="mainFrame">Crew Management</a><br>
    </span>
    
            <div class="menutitle" onclick="SwitchMenu('sub6')">Games</div>
    <span class="submenu" id="sub6">
    	- <a href="actiongames.php" target="mainFrame">Action</a><br>
    	- <a href="fightinggames.php" target="mainFrame">Fighting</a><br>
    	- <a href="racinggames.php" target="mainFrame">Racing</a><br>
                    - <a href="puzzelgames.php" target="mainFrame">Puzzle</a><br>
                    - <a href="othergames.php" target="mainFrame">Other</a><br>
    </span>
    
            <div class="menutitle" onclick="SwitchMenu('sub7')"><a href="Logout.php" target="mainFrame">Logout</a></div>
    <span class="submenu" id="sub7">
    </span>;
    
    </div> // line 168
    

     

    Carnt seem to find out why it says unexpected $end.

     

    Can anyone help please?

     

    Thanks for your help . :)

     

  11. Do you have a connection to the database in that code?

    Do you have it connecting to the table level is in?

    Do you have a level named owner?

    Yeah i have a connection to the database in the code

    I have the lvl called owner

    But what you mean by have it connecting to the table level is in?

  12. this should work

    <?php
    var_dump($row['level']);
    if($row['level'] == "owner"){
    ?>
    - <a href="../admin/index.php" target="mainFrame">Admin</a><br>
    <?php
    }
    ?>

    That dont show admin panel bit but it says NULL

  13. Doing that makes an error

     

    Parse error: syntax error, unexpected ')', expecting ']' in /home/a7502957/public_html/nav.php on line 133

     

    My code

     

    <div class="menutitle" onclick="SwitchMenu('sub1')">Staff Panel</div>
    <span class="submenu" id="sub1">
    <?php
    var_dump($row['level']);
    if($row['level' == "owner"){ // line 133
    ?>
    - <a href="../admin/index.php" target="mainFrame">Admin</a><br>
    <?php
    }
    ?>
    
    

  14. My code is now

     

    <div class="menutitle" onclick="SwitchMenu('sub1')">Staff Panel</div>
    <span class="submenu" id="sub1">
    	<?php
    var_dump($row['level'] == "owner"){ // line 132
    ?>
    - <a href="../admin/index.php" target="mainFrame">Admin</a><br>
    <?php
    }
    ?>
    

     

    But its now saying

    Parse error: syntax error, unexpected '{' in /home/a7502957/public_html/nav.php on line 132

  15. <div class="menutitle" onclick="SwitchMenu('sub1')">Staff Panel</div>
    <span class="submenu" id="sub1">
    	<?php
    if($row['level'] == "owner"){
    ?>
    - <a href="../admin/index.php" target="mainFrame">Admin</a><br>
    <?php
    }
    ?>
    

     

    That is basicly the script. Its part of my menu.

  16. in my database i have user lvl in the users table witch has lvls like owner But when i change

     

    <?php
    if($row['level']== owner {
    ?>
    

     

    It doesnt show the link to the users who have the user lvl owner

     

     

    This is what im trying.

     

    <?php
    if($row['level'] == owner){
    ?>
    - <a href="../admin/index.php" target="mainFrame">Admin</a><br>
    <?php
    }
    ?>
    

     

    but that dont show the link after

  17. Hi all on my website i have a mod panel witch only staff can see it (mod admin etc..) how could i code somthing so only the staff can see the link and access that page but users carnt? But if users try going to that url it move them to a different page?

     

    Thanks for you help :)

  18. It sounds like you're trying to tell me that the submit button isn't being echoed when it should.. whereas when it isn't supposed to, then it is being echoed?

     

    So pretty much:

     

    <?php
    
    if (echo == 'on')
    {
    // Do nothing.
    }
    elseif (echo == 'off')
    {
    echo 'Submit Button.';
    }
    
    ?>
    

     

    Is that about right? Sorry, I'm just confused and trying to figure out exactly what your problem is.

    Quite hard to explane :( well basicly i have a form echoed on my script with the email profile content etc boxes but users can wright in them but they carnt submit the data they have wrote because there isnt a submit button.

     

    On the script there is the submit button but it just isnt showing it.

  19. Allright.. My website has an profile system and when a user try's to edit there profile there isnt a submit button so they can, but when it isnt in the 'echo' tags the submit button shows. But im needing help on getting the submit button to show while its in the echo.

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