View Single Post
02-17-2008, 02:48 AM
#2
Gurnk is offline Gurnk
Status: Member
Join date: May 2007
Location: US
Expertise:
Software:
 
Posts: 380
iTrader: 12 / 100%
 

Gurnk is on a distinguished road

Send a message via AIM to Gurnk Send a message via MSN to Gurnk

  Old

You have a lot of random ending and non-ending tags and php tags in non-php areas, and html in php areas and a bunch of crazy stuff... This code puts all of the syntax in the right area. You should probably use the same syntax throughout the document. Like double quotes or single quotes all the way through.

PHP Code:
<?php
include("head.php");

//assign the cookie data
$id $data->cookie("id");
$pass $data->cookie("pass");
$user = new user($id,$pass);

//auth
if($user->auth() == false)
{
    
$flags ="<div id='wrapper'>
    <h1><a href='./' title='nookzu'>nookzu</a></h1>
    <p id='slogan'>its so easy, a caveman can do it!</p>
    <div id='login-top'>"
;
   
?>
        <?php include('loginc.php'); ?>    

    </div>

<?php include('sidebar.html'); ?>    

</div>
    <div id='content'>
        <h2>Manage your Themes</h2>
    </div>
        <p>
      <p>        Please login to manage your Themes.

</p>

      <h2>Advertisements</h2>';
     
<?php include('ads.html'); ?>    
</div>
    </div>
    <div id='footer'>
        <p>
            <a href='/bug.php' class='bug-report' title='Report a Bug'>Report a Bug</a>
        Copyright &copy; 2008 Nookzu. All rights reserved. An <a href='http://okcomplete.com'>okComplete</a> ventrue. </p>
  </div>
</div>
</body>
</html>

<?php
}

if(
$flags != null)
{
    echo 
$flags;
}
 
else
{
    
//if they are an admin, let them go to anyones management
    
if($user->admin_auth() == true && $data->get("id") != "")
    {
        
$user_id $data->get("id");
    }
    else
    {
        
$user_id $user->id;
    }
    
    
//get all the files that belong to the user
    
$files_query mysql_query("SELECT * FROM `files` WHERE `user_id` = '$user_id'");
    
    while(
$files mysql_fetch_array($files_query))
    {
        echo 
"<div id='wrapper'>
    <h1><a href='./' title='nookzu'>nookzu</a></h1>
    <p id='slogan'>its so easy, a caveman can do it!</p>
    <div id='login-top'>"
?>
        <?php include('loginc.php'); ?>    

    </div>
<?php include('sidebar.html'); ?>    
</div>
    <div id='content'>
        <h2>Manage your Themes</h2>
    </div>
        <p>
      <p>
      <?php 
       
echo = $file_name $files['name'];
       
$file_id $files['id'];
        
$file_link $files['file'];
        echo 
$file_name.' <a href=\'skins/$user_id/$file_link\'>Download</a> - <a href=\'delete.php?id=$file_id\'>Delete</a><br />';
       
?>
</p>

      <h2>Advertisements</h2>
<?php include('ads.html'); ?>    
</div>
    </div>
    <div id='footer'>
        <p>
            <a href='/bug.php' class='bug-report' title='Report a Bug'>Report a Bug</a>
        Copyright &copy; 2008 Nookzu. All rights reserved. An <a href='http://okcomplete.com'>okComplete</a> ventrue. </p>
  </div>
</div>
</body>
</html>
<?php
    
}
}
?>
If you aren't using a code editor with syntax highlighting, I'd recomend Notepad 2 (google it). It makes it a lot easier to catch those syntax errors.