•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,758 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 2,676 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: 20457 | Replies: 6
![]() |
•
•
Join Date: Aug 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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"> </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"> </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
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"> </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"> </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
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
[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
•
•
Join Date: Aug 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
[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
//$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
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.
•
•
Join Date: Jun 2006
Posts: 29
Reputation:
Rep Power: 3
Solved Threads: 0
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.
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.
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
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.
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- syntax error, unexpected $end in ndex.php on line 127 (PHP)
- parse error, unexpected T_STRING in (PHP)
- Parse error: parse error, unexpected T_STRING on line 12 (PHP)
- Please Help! parse error, unexpected T_STRING (PHP)
- Parse error: parse error, unexpected T_STRING (PHP)
- PHP Parse error: parse error, unexpected T_STRING (PHP)
- Parse error: parse error, unexpected T_STRING in /home/thei2k9/public_html/includes/f (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP/Linux Opening
- Next Thread: I Need Help To Do an e-vite with php & javascript


Linear Mode