CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Location
    Dallas, TX
    Posts
    47

    [RESOLVED] No Error but won't display

    php isnt giving me back any parse errors etc... but it will not display the forms i'm sure it's a logic error somewhere but i can't seem to locate it. I knwo it's alot alot of code to look it but the help will be appreciated
    PHP Code:
    <?php
    //Check for Session ID
        
        
    if (!$sessid){
            
    header("Location: login.php");
        }else{
            
    session_start();
            if(
    $status!="1"){
                
    header("Location: login.php");
            }
        }

    ?>
    <html>
    <head>
    <script type="text/javascript" src="sliding_menu.js.js"></script>
                <style type="text/css">
            .menu {
             background-color:#000099;
             border:1px solid black;
             width:150;
             font-size:11px;
             font-family:verdana;
             color: #FFFF00 ;
             font:bold;
            }

            .item_panel {
            width:150;
              border-left:1px solid black;
              border-right:1px solid black;
              clip:rect(0,150,0,0);
            }

            .item_panel a {
             text-decoration:none;
             color:black;
             cursor:hand;
            }

            .item {
             background-color:#0000cc;
             width:148;
             font-size:10px;
             color: #FFFF00;
             font-family:verdana;
            }

            </style>
    <title>Edit Games List</title>
    </head>
    <body bgcolor="#000000" text="#FFFF00">
    <center>
    <table width="800px" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse">
    <tr>
    <td width="800px" colspan="2">
    <img src="images/igllogo1.jpg" border="0">
    </td>
    </tr>
    <tr>

        <td  width="150px" bgcolor="#0000FF">
            <?php
                
    echo "User Name: ".$user"&nbsp;&nbsp;";
            
    ?>
        </td>
        <td width="650px" bgcolor="#0000FF">
            <p align="right">
            <?php echo date("l, F d, Y    h:i:s A"); ?>
            </p>
        </td>
    </tr>
    <tr>
    <td width="150px" bgcolor="#0000FF">
            <script language="JavaScript">
                    //Link[nr] = "position [0 is menu/1 is item],Link name,url,target (blank|top|frame_name)"
                    var Link = new Array();
                    Link[0] = "0|Profile";
                    Link[1] = "1|Home|user.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[2] = "1|Register Team|register.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[3] = "1|Register Name|register_game.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[4] = "1|Logout|login.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[5] = "0|Games";
                      Link[6] = "1|FPS|fps_list.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[7] = "1|Strategy|stratigy_list.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[8] = "0|Resources";
                      Link[9] = "1|Patches|download_patches.php?sessid=<?php echo $PHPSESSID?>|";
                      Link[10] = "1|Forum|/forum/|";
                      Link[11] = "1|Offical Game Sites||";
                      Link[12] = "0|Sponsors";
                      Link[13] = "1|Microbe Computers|http://www.microbecomputers.com|";
    <?php if ($admin="1"){ ?>
                      Link[14]= "0|Admin";
                      Link[15]= "1|Control Panel|admin.php?sessid=<?php echo $PHPSESSID?>|";
    <?php ?>
                      startup(1);
              </script>        
    </td>
    <td width="650px" bgcolor="#151515">
    <?php
    //Search for specified game to edit
    if ($search){
        if(
    $gameid){
            
    $db mysql_connect("localhost","microbec" "forsaken");
            
    mysql_select_db("microbec_igl",$db);
            
    $sql="SELECT * FROM games WHERE gameid='$gameid'";
            
    $result=mysql_query($sql);
            
    $myrow=mysql_fetch_array($result);
            
    $id=$myrow['gameid'];
        }else{
            if (
    $gamename){
                
    $db mysql_connect("localhost","microbec" "forsaken");
                
    mysql_select_db("microbec_igl",$db);
                
    $sql="SELECT * FROM games WHERE gamename='$gamename'";
                
    $result=mysql_query($sql);
                
    $myrow=mysql_fetch_array($result);
                
    $id=$myrow['gameid'];
            }else{
                if (
    $gamenamename2){
                    
    $db mysql_connect("localhost","microbec" "forsaken");
                    
    mysql_select_db("microbec_igl",$db);
                    
    $sql="SELECT * FROM games WHERE gamename='$gamename2'";
                    
    $result=mysql_query($sql);
                    
    $myrow=mysql_fetch_array($result);
                    
    $id=$myrow['teamid'];
                }
            }
        }
        
    //Display Edit Form
        
    ?>
        <form method="POST" action="<?php echo $PHP_SELF ?>?sessid=<?php echo $PHPSESSID?>">
              <div align="center">
            <center>
            <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="400" id="AutoNumber1">
                  <tr>
                    <td width="130">Game ID:</td>
                    <td width="267"><?php echo $myrow['gameid']; ?></td>
                  </tr>
                  <tr>
                    <td width="130">Game Name:</td>
                    <td width="267"><input type="text" name="name" size="20" value="<?php echo $myrow['gamename']; ?>"></td>
                  </tr>
                  <tr>
                    <td width="130">Game Type:</td>
                    <td width="267">
                        <select size="1" name="type">    
                            <option <?php if($myrow['gametype']=="1") echo " selected "?>value="1">FPS</option>
                            <option <?php if($myrow['gametype']=="2") echo " selected "?>value="2">Strategy</option>
                        </select></td>
                  </tr>
                  <tr>
                    <td width="130">Game Description:</td>
                    <td width="267"><textarea rows="2" name="desc" cols="20"><?php echo $myrow['gamedesc']; ?></textarea></td>
                  </tr>
                  <tr>
                    <td width="130">Game Logo:</td>
                    <td width="267"><input type="text" name="logo" size="20" value="<?php echo $myrow['image']; ?>"></td>
                  </tr>
                  <tr>
                    <td width="130">Game Trailer:</td>
                    <td width="267"><input type="text" name="trailer" size="20" value="<?php echo $myrow['trailer']; ?>"></td>
                  </tr>
                  <tr>
                    <td width="130">Game Patch Version:</td>
                    <td width="267"><input type="text" name="version" size="20" value="<?php echo $myrow['patchversion']; ?>"></td>
                  </tr>
                  <tr>
                    <td width="130">Game Patch File:</td>
                    <td width="267"><input type="text" name="file" size="20" value="<?php echo $myrow['patchfile']; ?>"></td>
                  </tr>
                  <tr>
                    <td width="130">Game Patch Date:</td>
                    <td width="267"><input type="text" name="date" size="20" value="<?php echo $myrow['patchdate']; ?>"></td>
                  </tr>
            </table>
            </center>
              </div>
              <p align="center">
              <input type="hidden" value="<?php echo $myrow['gameid']; ?>" name="gameid">
              <input type="submit" value="Submit" name="update">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input type="reset" value="Reset" name="reset"></p>
        </form>
     }
        //Add New Game into database Games
        if($add){
            $db = mysql_connect('localhost','microbec','forsaken');
            mysql_select_db('microbec_igl',$db);
            $sql="INSERT INTO games (gamename,gametype) VALUES ('$GameName','$Type')";
            $result=mysql_query($sql);
            $msg="Game Added, Please <a href=\"admin.php?sessid=" . $PHPSESSID . "\">Click Here</a> to return to Control Panel.";
            echo $msg;
        }else{
        // Search Display Add Form
            ?>
            <form method="POST" action="<?php echo $PHP_SELF ?>?sessid=<?php echo $PHPSESSID?>">
              <div align="center">
                <center>
                    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="250" id="AutoNumber1">
                          <tr>
                            <td width="87">
                                <p align="center">Game Name:</td>
                            <td width="160">
                                <p align="center"><input name="GameName" size="20" style="float: left"></td>
                          </tr>
                          <tr>
                            <td width="87">
                                <p align="center">Game Type:</td>
                            <td width="160">
                                    <p align="left">
                                <select size="1" name="Type">
                                    <option value="1">FPS</option>
                                    <option value="2">Stratigy</option>
                                </select></td>
                          </tr>
                    </table>
                </center>
              </div>
              <p align="center"><input type="submit" value="Submit" name="add"><input type="reset" value="Reset" name="B2"></p>
            </form>
            <?php
            
    //Display Search Form
            
    ?>
            <form method="POST" action="<?php echo $PHP_SELF ?>?sessid=<?php echo $PHPSESSID?>">
              <div align="center">
            <center>
            <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="300">
              <tr>
                <td width="50%">Team ID:</td>
                <td width="50%"><input type="text" name="gameid" size="20"></td>
              </tr>
              <tr>
                <td width="50%">Team Name:</td>
                <td width="50%"><input type="text" name="gamename" size="20"></td>
              </tr>
              <tr>
                <td width="50%">Team Name:</td>
                <td width="50%">
                    <select size="1" name="gamename2">
                          <?php 
                            $db 
    mysql_connect("localhost","microbec" "forsaken");
                            
    mysql_select_db("microbec_igl",$db);
                            
    $sql="SELECT * FROM games";
                            
    $result=mysql_query($sql);
                            while(
    $myrow2=mysql_fetch_array($result)){
                                echo 
    "<option>" $myrow2['gamename'] . "</option>";
                            }
                          
    ?>
                      </select></td>
              </tr>
            </table>
            </center>
              </div>
              <p align="center"><input type="submit" value="Submit" name="search">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input type="reset" value="Reset" name="reset"></p>
            </form>
            <?php 
        
    }  
    ?>
    </td>
    </tr>
    <tr>
    <td width="800px" colspan="2" bgcolor="#0000FF">
    &nbsp;
    </td>
    </table>
    </center>
    </body>
    </html>

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: No Error but won't display

    If there is no PHP error, then it is probably HTML layout. View the source of the loaded page.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured