Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 08-30-2004, 08:54 PM   #16 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,503
sde is on a distinguished road
lol, are you even trying to debug or figure out what is wrong on line 80?

generally you won't get much on screen when you have parse errors. i had to copy your code into my editor to find line 80, .. like i asked before, it really helps a lot if you point out which line it is.

PHP Code:
  return $who_online_now;

it's really cool how nice php debugging is .. look at line 80 and uncomment the '}'

could you use the [php ] and [/ php] tags when you post code too it makes it much easier to read.
__________________
Mike
sde is offline   Reply With Quote
Old 08-30-2004, 09:42 PM   #17 (permalink)
xtrax_22
Registered User
 
xtrax_22's Avatar
 
Join Date: Aug 2004
Posts: 8
xtrax_22 is on a distinguished road
Ok l did that and l get this error now


Parse error: parse error in /home/virtual/site13/fst/var/www/html/tes1t.php on line 77


here is the code

PHP Code:
<?php 
include("header.php");   
$index 0;     
//require_once("mainfile.php");     
$module_name basename(dirname(__FILE__)); 

function 
who_online() {    
  global 
$prefix$db;    
  
$sql "SELECT uname, guest FROM ".$prefix."_session WHERE guest = 0";    
  
$result $db->sql_query($sql);    
  
$member_online_num $db->sql_numrows($result);    
  
$who_online_now "";    
  
$i 1
   
  
OpenTable();   
  
$count 0;   
  echo 
"<table border=\"1\" cellspacing=\"10\" cellpadding=\"10\">"
    
  while(
$session $db->sql_fetchrow($result)) {   
      
    if(isset(
$session["guest"]) and $session["guest"] == 0) {    
      
$sql ="select user_id from ".$prefix."_users where username='$session[uname]'"
       
      list(
$user_id) = mysql_fetch_row(mysql_query($sql)); 
      
$count++;    
                
      if(
$count == 1) { echo "<tr>"; } 
      
$path "/home/virtual/site13/fst/var/www/html/modules/Photo/memberphotos/";
      if(
file_exists($path.$userid.".jpg")){ 
      
$file=$path.$userid.".jpg"
      }elseif(
$file_exists($path.$userid.".gif")){ 
      
$file=$path.$userid.".gif"

       
$who_online_now .= "<TD><center><A HREF=\"modules.php?name=Your_Account&op=userinfo&username=$session[uname]\"><img src=\"$file\" border=\"0\" alt=\"$session[uname]\"><br>$session[uname]</center></TD></a>\n";
       if(
$count == 3)   { echo "</tr>"$count=0; }    
      } 
    } 
  }
  if(
$count == 1) { echo "<td>&nbsp;</td><td>&nbsp;</td></tr>"; } 
  if(
$count == 2) { echo "<td>&nbsp;</td></tr>"; } 
  echo 
"</table>"
   
  
// up to here looks good, we printed and closed the user table 
  // ************************* 
  // what is the rest of this for? 
  // it looks like a bad copy and paste or something. 
   
  // begin commenting out bad code 
  /* 
  $count++;    
  if($count == 1) { echo "<tr>"; }        
  $i++; 
   
  } 
   
  elseif(file_exists("/home/virtual/site13/fst/var/www/html/modules/Photo/memberphotos/$user_id.gif")) { 
    $who_online_now .= "<TD><center><A HREF=\"modules.php?name=Your_Account&op=userinfo&username=$session[uname]\"> 
    <img src=\"modules/Photo/memberphotos/$user_id.gif\" border=\"0\" alt=\"$session[uname]\"><br>$session[uname]</center></TD></a>\n"; 
    if($count == 3)   { echo "</tr>"; }    
    if($count == 3)   { $count = 0; }    
  } 



if($count == 1) { echo "<td>&nbsp;</td><td>&nbsp;</td></tr>"; } 
if($count == 2) { echo "<td>&nbsp;</td></tr>"; } 
echo "</table>"; 
$i++; 
    } 
  }    
   
  } 
  // end commenting out bad code 
  */ 
   
return $who_online_now;    

// here is line 78 so above it is line 77

$some_stuff who_online();   
echo 
"$some_stuff"
CloseTable(); 
include(
"footer.php");   
   
// } this closing brace does not belong here 
?>

Sorry about the other hope its easier to read now..

XtraX

Last edited by sde; 08-30-2004 at 10:06 PM.
xtrax_22 is offline   Reply With Quote
Old 08-30-2004, 10:24 PM   #18 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,503
sde is on a distinguished road
lol, you didn't answer my first question. i'm done being your monkey .. good luck
__________________
Mike
sde is offline   Reply With Quote
Old 08-31-2004, 09:08 AM   #19 (permalink)
xtrax_22
Registered User
 
xtrax_22's Avatar
 
Join Date: Aug 2004
Posts: 8
xtrax_22 is on a distinguished road
OK did l miss read a post what was your first question ..?

I provide what ever you ask and l even pointed out the parser error line 77 ..

what are you refering to.

Xtrax
xtrax_22 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
making a 3 column table dynamically sde PHP 8 08-28-2004 07:14 PM
table cell highlight and text change on mouseover EscapeCharacter HTML, XML, Javascript, AJAX 13 09-09-2003 12:28 AM
help me name a table sde Lounge 4 12-07-2002 12:50 PM


All times are GMT -8. The time now is 06:02 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting