Jump to content


Photo

Page Content Not Showing


  • Please log in to reply
2 replies to this topic

#1 hellbringer80

hellbringer80
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 June 2006 - 02:35 PM

i have been making this site for my onling gaming team. Everything seems to work fine but for some reason the content on the command page won't work. I have only coded the profiles, members page, console, and matches page so far. For some reason everything shows up except when I go to the match_options.php page and the content doesn't show up. Also, the users profile won't show up either. The following pages in order are. The site can be viewed at www.team-lockdown.net/audacity The test login is Username: Admin Password: admin123
1. functions.php (including both the profile page, and the match options.
2. matches.php (displays the matches to everyone)
3. profile.php (displays the users profile)
4. match_options.php (gives you the options to edit the matches page)

functions.php
// This function displays the profile of any user.  This is shown in the
// main login, and in the profile page.

function displayProfile($user, $ip) {
  global $fontString, $tbheader, $fontCo, $fontcolor, $tableColor, $tableString;

  $result = @mysql_query("SELECT * FROM members WHERE username = \"$user\"");
  $row = mysql_fetch_array($result);
  extract($row);

  $result = @mysql_query("SELECT * FROM status WHERE id = \"1\"");
  $row = mysql_fetch_array($result);
  extract($row);

  $days = calcDays($username);
  $dsl = calcDSL($username);
  $prom = calcPromo($username);
  $percentage = ($recruits / $num_mems) * 100;

echo("
<center>
<table>
<tr><td><img src=images/$rank.gif>");

$rank = getRankByNum($rank);

echo("
  </td>
    <td>$fontString
<font size=4><b> &nbsp;$fname $username $lname
</font></b></center>
</td></tr>
  </table>");

echo("


<table border=0 width=$tablewidth>
<tr><td width=30%>Player Alias</td><td width=70%>$username</td></tr>
<tr><td>Real Name</td><td>$fname $lastname</td></tr>
<tr><td>Email</td><td>$email</td></tr>
<tr><td>Status</td><td>$rank</td></tr>
<tr><td>Location</td><td>$city $state</td></tr>
<tr><td>Age</td><td>$age</td></tr>
<tr><td>Quote</td><td>$quote</td></tr>
</table>");
}


// Display Matches

function dispmatches()
{
  global $fontString, $tableColor, $tbheader, $tablewidth;

  echo("
<center>
    <table width=$tablewidth align=center border=0 cellspacing=0>
    <tr><td colspan=4>
        <center><b>$fontString
        <font size=5>Matches</font>
</b><br><BR>
    </td></tr>
<center>
        <tr><td width=20% bgcolor=$tableColor background=$tbheader>
            <b><font color=#FFFFFF size=2 face=verdana><center>
            Opponent</font><br></b>
        </td><td width=20% bgcolor=$tableColor background=$tbheader>
            <b><font color=#FFFFFF size=2 face=verdana><center>
            Score</font><br></b>
        </td><td width=60% bgcolor=$tableColor background=$tbheader>
            <b><font color=#FFFFFF size=2 face=verdana><center>
            Demo</font><br></b>
        </td></tr>

  ");

  $result = @mysql_query("SELECT * FROM match");
  while($row = mysql_fetch_array($result)) {
    extract($row);

    echo("
        <tr><td width=20% bgcolor=$tableColor>
            $fontString
            <center>Audacity vs. $opponent<br><br>
        </td><td width=20% bgcolor=$tableColor>
            $fontString
            <center>$score<br><br>
        </td><td width=60% bgcolor=$tableColor>
            $fontString
            <center>$demo<br><br>
        </td></tr>

    ");
  }

  echo("
    </table>
  ");
}

Matches.php
<?php

$username = $usercook;
$password = $passcook;
setcookie("usercook", $username);
setcookie("passcook", $password);

require("functions.php");


dispmatch();


include("footer.php");

?>

profile.php
<?php

$username = $usercook;
$password = $passcook;
setcookie("usercook", $username);
setcookie("passcook", $password);

require("functions.php");


displayProfile($user, $ip);


include("footer.php");

?>

match_options.php
<?php

$username = $usercook;
$password = $passcook;
setcookie("usercook", $username);
setcookie("passcook", $password);

require("functions.php");


if(authenticate($username, $password, 2)) {
  global $fontString, $tableColor, $tablewidth;

  dispmatch();

  echo("
    <p>
    <table width=$tablewidth cellspacing=0 cellpadding=0>
    <tr><td>
        <center><b>$fontString
        <font size=2>Match Options</font>
    </td></tr>
    <tr><td width=$tablewidth bgcolor=$tableColor><center>
        $fontString <b>
        <a href=add_match.php>Add Match</a> <b>|</b>
         <a href=rem_match.php>Remove Match</a> <b>|</b>
         <a href=mod_match.php>Modify Match</a> </b></center>
    </td></tr>
      <tr><td bgcolor=$tableColor colspan=2><br>
<center><font size=2 face=verdana><b><a href=main.php>Return to main menu</font></b></center>
      </td></tr>
    </table>
  ");
}


include("footer.php");

?>


#2 hellbringer80

hellbringer80
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 June 2006 - 05:18 PM

Come on people I really need help with this, I'm getting payed for coding this but I just don't know why it's not showing up on the page, I asked like 10 friends that knew php and they said nothing is wrong with it but obviously something is wrong =/

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 05 June 2006 - 05:48 PM

Oh, you're getting for paid for it and we have to help out and you're in a hurry.

Let's see. It could be what appears to be an assumption that register_globals is ON when it might (should) be off on the production server; it could be that none of the queries are actually working the way you expected. Try recoding them so that they display errors if errors exist (and not suppressing the errors as well). It could be a scope problem with variables in functions. It could be that the problems exist in functions for which you haven't provided code. Or it could be who knows what.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users