View Single Post
  #125  
Old 05-19-2005, 03:09 PM
  chetlucas's Avatar 
chetlucas chetlucas is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Inverness, Florida
Posts: 56
 

Default Parse error when stripping the "s" from include/se

I have added the below code to remove the last "s" from search string, but receive a smarty sparse error "Parse error: parse error, unexpected $ in /home/giftcom/public_html/include/search.php on line 659"

// LOOK HERE
// new bit to split search string into separate words
$con = ""; $substr = "";
$and="AND";

if(!$substring) { $substring=" "; }
if(!empty($substring)){

// code to strip last s from search string
$substring = trim($substring);
$start = (strlen($substring)-1);
// echo $start;
// echo "
";
if ((substr($substring,$start,1)=="s")||(substr($subs tring,$start,1)=="S")){
$substring = substr($substring,0,$start);
// echo $substring;
}
// end of new funkydunk bit

Can this be fixed? What and where does the correct code go?
__________________
X-Cart version 4.1.11 (Unix)
Apache version 1.3.41 (Unix)
MySQL version 5.0.67 - community
PHP version 5.2.5
PERL version 5.8.8
http://www.etekmart.com
Reply With Quote