User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 392,002 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,170 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 19571 | Replies: 6
Reply
Join Date: Aug 2006
Posts: 2
Reputation: pete harby is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pete harby pete harby is offline Offline
Newbie Poster

Parse error: syntax error, unexpected T_STRING

  #1  
Aug 21st, 2006
Hi

I am really struggling here and cant see the syntax error.

It is probably a " but could really do with a hand as to why I get the error:

unsxpected T_STRING on line 14

My php code is as follows:

[php]<?php

include_once("php/library/lib.php");
include_once("php/library/template.php");
include_once("php/library/database.php");


//
//$database = new database();//$security = new security();//$security->allowed_get("PHPSESSID");//$security->check_vars(false);//
$page = new template( "index.html" );
//$page->lockToLoggedIn = false;
//$security->set_counters(page);//$page->setRegionVisable("lines",true);// Build the actual page contents display
//$pageDtls = '<table cellpadding=0 cellspacing=0 border=0>';//$pageDtls .= '<tr><td>';//$pageDtls .= '<?region-start id="lines" type="repeat" ?>';//$pageDtls .= '<center>';//$pageDtls .= '<table class="browseContents" width="100%" border="0" cellspacing="0" cellpadding="1">';//$pageDtls .= '<tr>';
//$pageDtls = '<table cellpadding=0 cellspacing=0 border=0><tr><td><?region-start id="lines" type="repeat" ?><center><table class="browseContents" width="100%" border="0" cellspacing="0" cellpadding="1"><tr>';
//
//$img_width = 85;//$img_height = 30;
// Build a grid of ALL cells
//for ( $cat_set = 1 ; $cat_set < (MAX_CATS + 1); $cat_set ++ )//{// $categories = array();// $cat_hdrs = array();//
//// // Find all Categories for the current set//// $sqlQry = "SELECT *// FROM categories// WHERE cat_set_no = " . $cat_set . "// ORDER BY cat_pos_no";//
// $result = $database->runQuery( $sqlQry );// $rows = $database->numRows();//
// for ($a = 0 ; $a < $rows ; $a ++ )// {// $catObj = $database->getObject();//// $categories[$catObj->cat_pos_no -1] = $catObj->cat_id;// $cat_hdrs[$catObj->cat_pos_no -1] = $catObj->cat_name;// }////
// // Set the category headers//// for ( $cat_no = 0 ; $cat_no < 10; $cat_no ++ )// {// $pageDtls .= '<td id="hdrCell" valign="top">' . $cat_hdrs[$cat_no] . '</td>';// $pageDtls .= '<td id="spaceCell">&nbsp;</td>';// }////// $pageDtls .= '</tr>';// $pageDtls .= '<?repeat-line-start?>';//
// // Set Cell Details//
// for ( $line_no = 1 ; $line_no < (MAX_ROWS + 1); $line_no ++ )// {// $pageDtls .= '<tr>';//
// for ( $cat_no = 0 ; $cat_no < 10; $cat_no ++ )// {// $pageDtls .= '<td id="singleCell" valign="top">';//// $cellObj = $database->getSingleObject("SELECT *// FROM cells// WHERE cell_category = '" . $categories[$cat_no] . "'// AND cell_no = " . $line_no);//// if ($cellObj != null)// {// if ($cellObj->cell_status === "R")// {// $pageDtls .= '<a href="#">';// $pageDtls .= '<img src="/pages/images/img_reserved.png" width=' . $img_width . ' height=' . $img_height . ' border="1">';// }//
// if ($cellObj->cell_status === "S")// {// $pageDtls .= '<a href="' . $cellObj->cell_url . '">';// $pageDtls .= '<img src="/pages/sold/' . $cellObj->cell_image . '" width=' . $img_width . ' height=' . $img_height . ' border="1">';// }// }// else// {// $pageDtls .= '<a href="' . STORE_PATH . 'buy.php?category='. $categories[$cat_no] . '&cell=' . $line_no . '">';// $pageDtls .= '<img src="/pages/images/img_available.png" width=' . $img_width . ' height=' . $img_height . ' border="1">';// }//// $pageDtls .= '</a>';// $pageDtls .= '</td>';// $pageDtls .= '<td id="spaceCell">&nbsp;</td>';// }//// $pageDtls .= '</tr>';// }//}//
//unset($database);//
//$pageDtls .= '<?repeat-line-end?>';//$pageDtls .= '</table>';//$pageDtls .= '</center>';//$pageDtls .= '<?region-end?>';//$pageDtls .= '</td></tr>';//$pageDtls .= '</table>';//$page->setItem( "page-details" , $pageDtls );

// Display the page

echo $page->process();

?>[/php]

I am desperate for some help as I have been staring at this for a day or so.

all the best

Pete
Last edited by cscgal : Aug 22nd, 2006 at 7:51 pm. Reason: Added code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2003
Location: Fargo, ND
Posts: 301
Reputation: big_k105 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 2
Colleague
big_k105's Avatar
big_k105 big_k105 is offline Offline
Coding God (i wish)

Re: Parse error: syntax error, unexpected T_STRING

  #2  
Aug 21st, 2006
First off please put your code inside of the php code tags
[php]Code here[/php]

The error is on line 14 but I can't really tell where line 14 starts in your code. Please either clean the code up a little or just give use lines 12-17 or something like that. Thanks
Reply With Quote  
Join Date: Aug 2006
Posts: 2
Reputation: pete harby is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pete harby pete harby is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING

  #3  
Aug 21st, 2006
[php]//$security->set_counters(page);//$page->setRegionVisable("lines",true);// Build the actual page contents display
//$pageDtls = '<table cellpadding=0 cellspacing=0 border=0>';//$pageDtls .= '<tr><td>';//$pageDtls .= '<?region-start id="lines" type="repeat" ?>';//$pageDtls .= '<center>';//$pageDtls .= '<table class="browseContents" width="100%" border="0" cellspacing="0" cellpadding="1">';//$pageDtls .= '<tr>';
//$pageDtls = '<table cellpadding=0 cellspacing=0 border=0><tr><td><?region-start id="lines" type="repeat" ?><center><table class="browseContents" width="100%" border="0" cellspacing="0" cellpadding="1"><tr>';
//
//$img_width = 85;//$img_height = 30;
// Build a grid of ALL cells[/php]


lines 12 - 17 as requested thanks for your help
Pete
Reply With Quote  
Join Date: May 2003
Location: Fargo, ND
Posts: 301
Reputation: big_k105 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 2
Colleague
big_k105's Avatar
big_k105 big_k105 is offline Offline
Coding God (i wish)

Re: Parse error: syntax error, unexpected T_STRING

  #4  
Aug 21st, 2006
Well the error isn't in those lines because they are all commented out. The only thing I could see is that maybe the error is in one of the included files.
Reply With Quote  
Join Date: Jun 2006
Posts: 29
Reputation: Woobag is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Woobag Woobag is offline Offline
Light Poster

Re: Parse error: syntax error, unexpected T_STRING

  #5  
Aug 23rd, 2006
I can tell you that my personal experiences not T_STRING, as in your case, but T_INC came from not putting the "$" sign in front of a variable in a for loop. Check your syntax on your strings and your problem may be hidden somewhere in one of them...

It took me a lot of searching on the internet one day for something so simple. Then, after a some sleep, i woke up and saw the obvious mistake, corrected it, and the program worked perfectly.
Last edited by Woobag : Aug 23rd, 2006 at 10:34 pm.
Reply With Quote  
Join Date: Sep 2006
Posts: 9
Reputation: pzuurveen is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
pzuurveen pzuurveen is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING

  #6  
Sep 11th, 2006
do you notice the de color of the code chanched after

[PHP]
<?region-start id="lines" type="repeat" ?>
[/PHP]
the ?> tag closes the php sesion despate it being commened out by //

use of /* */ comment will solve this
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Parse error: syntax error, unexpected T_STRING

  #7  
Sep 11th, 2006
I just got Deja vu reading this thread. Twice I thought "I wrote that" and saw someone elses name. Am I having that much of an effect here? :-)
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

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

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 10:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC