This is a discussion on problem writing text search function within the PHP Language forums, part of the PHP Programming Forums category; i get "Parse error: parse error in /home/houseproudlancs_co_uk/search.php on line 65" when i open the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
i get "Parse error: parse error in /home/houseproudlancs_co_uk/search.php
on line 65" when i open the page, line 65 would be the line that starts with if (textsearch $search_for = "is"; $the_items_description = "this is where the description would go"; if (textsearch($item_category) == true { echo ("correct"); } else { echo ("incorrect"); } function textsearch($the_items_description) { $pos = strpos($the_items_description, $search_for); if ($pos === false) { textsearch = false; } else { textsearch = true; } |
|
|||
|
On 9-Jan-2004, Matthew Robinson <mattyrobinson69@hotmail.com> wrote: > i get "Parse error: parse error in /home/houseproudlancs_co_uk/search.php > on line 65" when i open the page, line 65 would be the line that starts > with if (textsearch > > $search_for = "is"; > $the_items_description = "this is where the description would go"; > if (textsearch($item_category) == true { > echo ("correct"); > } else { > echo ("incorrect"); > } You need another ) on the if -- Tom Thackrey www.creative-light.com tom (at) creative (dash) light (dot) com do NOT send email to jamesbutler@willglen.net (it's reserved for spammers) |
|
|||
|
In article <pan.2004.01.09.20.48.56.405332@hotmail.com>,
mattyrobinson69@hotmail.com says... > i get "Parse error: parse error in /home/houseproudlancs_co_uk/search.php > on line 65" when i open the page, line 65 would be the line that starts > with if (textsearch > > $search_for = "is"; > $the_items_description = "this is where the description would go"; > if (textsearch($item_category) == true { 2 open brackets and only on closed. -- ************************************** The Eldritch Dark: Dedicated to Clark Ashton Smith http://www.eldritchdark.com/ |
|
|||
|
On 9-Jan-2004, Matthew Robinson <mattyrobinson69@hotmail.com> wrote: > that didn't help unfortunately (please forgive me for the VB coder type > error - im used to VB wiping my bum for me) any other idea's? consider quoting whatever the hell you are referring to and what you did and what the new problem is. -- Tom Thackrey www.creative-light.com tom (at) creative (dash) light (dot) com do NOT send email to jamesbutler@willglen.net (it's reserved for spammers) |
|
|||
|
Matthew Robinson wrote:
> that didn't help unfortunately (please forgive me for the VB coder type > error - im used to VB wiping my bum for me) any other idea's? >>> if (textsearch($item_category) == true { _______^__________^______________^________________ __________ ??????? where did you put the missing ")"? -- --= my mail box only accepts =-- --= Content-Type: text/plain =-- --= Size below 10001 bytes =-- |
|
|||
|
the original problem was i get "Parse error: parse error in
/home/houseproudlancs_co_uk/search.php on line 65" when i open the page, line 65 would be the line that starts with if (textsearch the help suggested was to put the missing ) on the if statement, i have done this (as below) and it didn't help $search_for = "is"; $the_items_description = "this is where the description would go"; if (textsearch($item_category)) == true { echo ("correct"); } else { echo ("incorrect"); } function textsearch($the_items_description) { $pos = strpos($the_items_description, $search_for); if ($pos === false) { textsearch = false; } else { textsearch = true; } |
|
|||
|
On Fri, 09 Jan 2004 22:55:12 +0000, Pedro Graca wrote:
> Matthew Robinson wrote: >> that didn't help unfortunately (please forgive me for the VB coder type >> error - im used to VB wiping my bum for me) any other idea's? > >>>> if (textsearch($item_category) == true { > _______^__________^______________^________________ __________ ??????? > > where did you put the missing ")"? it was if (textsearch($item_category) == true { i replaced this with if (textsearch($item_category)) == true { |
|
|||
|
Matthew Robinson wrote:
> it was > if (textsearch($item_category) == true { > > i replaced this with > if (textsearch($item_category)) == true { And as you've seen that is still wrong. Try again. Hint: check the if() syntax http://www.php.net/manual/en/control...-structures.if -- --= my mail box only accepts =-- --= Content-Type: text/plain =-- --= Size below 10001 bytes =-- |
|
|||
|
On 9-Jan-2004, Matthew Robinson <mattyrobinson69@hotmail.com> wrote: > if (textsearch($item_category)) == true { You put the missing ) in the wrong place it should be: if (textsearch($item_category) == true) { -- Tom Thackrey www.creative-light.com tom (at) creative (dash) light (dot) com do NOT send email to jamesbutler@willglen.net (it's reserved for spammers) |