Jump to content


Photo

what is write context error


  • Please log in to reply
3 replies to this topic

#1 koolaidman52

koolaidman52
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 30 July 2006 - 08:44 PM

Can anybody tell me what my problem is with this? (error edtails below)
.
.
.

  if (strtoupper(trim($which)) =  'CITY')
  { return $city;}
   
  if (strtoupper(trim($which)) = 'STATE')
  {  return $state;}
   
  if (strtoupper(trim($which)) = 'BOTH')
  {  return $citystate; }

Fatal error: Can't use function return value in write context in C:\Program Files\Apache Group\Apache2\htdocs\functions.php on line 32

Line 32 is the first if

code functioned fine without the ifs when I just

return $city;

Thanks
Btcartoons.com --  coded entirely in Mom's basement.

#2 pedrobcabral

pedrobcabral
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 30 July 2006 - 09:36 PM

if (strtoupper(trim($which)) =  'CITY')
= does not exists as comparison operator.

== Equal
!= Not equal
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
=== Identical

#3 koolaidman52

koolaidman52
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 30 July 2006 - 09:50 PM

thank you
Btcartoons.com --  coded entirely in Mom's basement.

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 31 July 2006 - 02:47 AM

Don't double post.  You asked exactly the same question in another forum here AND I advised you of the error in reply.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users