Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1848 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Can someone tell me what's wrong?

Thread title: Can someone tell me what's wrong?
Closed Thread    
    Thread tools Search this thread Display Modes  
02-17-2008, 02:28 AM
#1
Christian is offline Christian
Christian's Avatar
Status: Request a custom title
Join date: Sep 2006
Location:
Expertise:
Software:
 
Posts: 1,033
iTrader: 22 / 92%
 

Christian is on a distinguished road

  Old  Can someone tell me what's wrong?

Hey, this may be a stupid question, so sorry in advanced. But I am getting an error with this file..
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>"
;
}

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>"
    
}
}
?>
And the error i get is this: Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/chris/public_html/manage.php on line 98

any ideas?

Any help would be greatly appreciated

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.

02-25-2008, 08:55 AM
#3
bytelaunch is offline bytelaunch
Status: I'm new around here
Join date: Feb 2008
Location:
Expertise:
Software:
 
Posts: 5
iTrader: 0 / 0%
 

bytelaunch is on a distinguished road

  Old

Could I recommend Notepad++ ?

I have been using it for years! It has some really great syntax highlighting options for just about every language you can think of. Also - you can write C addons if you are feeling daring. Check it out:

http://notepad-plus.sourceforge.net/

I'm sure many others here use this fine application!

Tell me how you like it!

Best,

Michael Craig

03-06-2008, 02:48 PM
#4
VernonK is offline VernonK
VernonK's Avatar
Status: Junior Member
Join date: Jan 2007
Location: Western Maryland
Expertise:
Software:
 
Posts: 39
iTrader: 0 / 0%
 

VernonK is on a distinguished road

Send a message via MSN to VernonK

  Old

I would definitely recommend an editor with good syntax highlighting as well. This will give you the ability to see when you have a syntax error. I'm not sure if Notepad++ does (bytelaunch can probably tell you) but I know Zend Studio (not free though) has a code analyzer that will show you specific errors.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed