DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   Parse error: syntax error, unexpected T_STRING (http://www.daniweb.com/forums/thread52975.html)

pete harby Aug 21st, 2006 6:17 am
Parse error: syntax error, unexpected T_STRING
 
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

big_k105 Aug 21st, 2006 10:23 am
Re: Parse error: syntax error, unexpected T_STRING
 
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

pete harby Aug 21st, 2006 10:35 am
Re: Parse error: syntax error, unexpected T_STRING
 
[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

big_k105 Aug 21st, 2006 1:14 pm
Re: Parse error: syntax error, unexpected T_STRING
 
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.

Woobag Aug 23rd, 2006 11:07 pm
Re: Parse error: syntax error, unexpected T_STRING
 
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.

pzuurveen Sep 11th, 2006 11:45 am
Re: Parse error: syntax error, unexpected T_STRING
 
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

Puckdropper Sep 11th, 2006 1:13 pm
Re: Parse error: syntax error, unexpected T_STRING
 
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? :-)


All times are GMT -4. The time now is 9:43 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC