Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10833

Re: Setting & displaying Variables

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail
From Twayne <nobody@spamcop.net>
Newsgroups comp.lang.php
Subject Re: Setting & displaying Variables
Date Sun, 22 Sep 2013 17:19:13 -0400
Organization Aioe.org NNTP Server
Lines 61
Message-ID <l1nmsg$k7e$1@speranza.aioe.org> (permalink)
References <l1kv32$ll0$1@speranza.aioe.org> <8t3s39tcmb842b3dkpa8fja7qqdvfqvieq@4ax.com>
NNTP-Posting-Host iwHyFpXp4Q47LCZI1ZC61Q.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.php:10833

Show key headers only | View raw


On 2013-09-21 5:29 PM, Richard Yates wrote:
> On Sat, 21 Sep 2013 16:20:49 -0400, Twayne <nobody@spamcop.net> wrote:
>
> Probably those three Ms in '$commments'

CRAP!!  I can't tell you how many times I looked at that code and didn't 
see it!
    But, that's all it took was to spell the var correctly, of course. I 
am severely humbled and owe you a drink at the local bar were it 
possible, or some other thing you'd appreciate if you're not a drinker! 
  Any chance you live in far upstate NY?

Regards,

Twayne`



>
>
>> Hi,
>>
>> Obviously, the issue is around the comments var. It works, but it
>> doesn't and I'm hoping someone can explain why.
>>
>> Both echo strlen($comments);  and   echo $comments;    throw a Notice
>> about an undefined variable. But the variable "comments" HAS to have
>> been defined in order for the two echo statements to work!
>>     The variable 'comments' is also in SESSION data, which will also get
>> the same Notice of an undefined variable.
>>
>> What the heck am I missing? Why do I get the undefined var in those two
>> statements?
>>
>> ===================
>> <code>
>> echo strlen($_POST["comments"])."<br />"; //WORKS
>>
>> $commments = $_POST["comments"]; // WORKS but not needed; done elsewhere
>> too.
>>
>> // echo strlen($comments);  // GETS Notice: Undefined variable: comments
>> in C:\xampp\htdocs... and nothing displays.
>>
>> echo $_POST["comments"]; // WORKS
>> //echo $comments;   // GETS Notice: Undefined variable: comments in C
>> ... and nothing displays.
>>
>> </code>
>> ===================
>>
>> I'm obviously missing something here since it appears the var is set
>> according to the 2 statements that do display what I expected. Can you
>> straighten me out? I've had this happen before with other vars and it's
>> always confusing.
>>
>> TIA,
>>
>> Twayne`
>>

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Setting & displaying Variables Twayne <nobody@spamcop.net> - 2013-09-21 16:20 -0400
  Re: Setting & displaying Variables Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-21 16:25 -0400
  Re: Setting & displaying Variables The Natural Philosopher <tnp@invalid.invalid> - 2013-09-21 21:29 +0100
  Re: Setting & displaying Variables Richard Damon <Richard@Damon-Family.org> - 2013-09-21 16:47 -0400
    Re: Setting & displaying Variables Twayne <nobody@spamcop.net> - 2013-09-22 16:47 -0400
      Re: Setting & displaying Variables Richard Damon <Richard@Damon-Family.org> - 2013-09-22 17:58 -0400
  Re: Setting & displaying Variables Richard Yates <richard@yatesguitar.com> - 2013-09-21 14:29 -0700
    Re: Setting & displaying Variables Twayne <nobody@spamcop.net> - 2013-09-22 16:54 -0400
    Re: Setting & displaying Variables Twayne <nobody@spamcop.net> - 2013-09-22 17:19 -0400
      Re: Setting & displaying Variables Richard Yates <richard@yatesguitar.com> - 2013-09-22 14:39 -0700
        Re: Setting & displaying Variables Twayne <nobody@spamcop.net> - 2013-09-23 19:54 -0400
  Re: Setting & displaying Variables "J.O. Aho" <user@example.net> - 2013-09-21 23:55 +0200
    Re: Setting & displaying Variables Twayne <nobody@spamcop.net> - 2013-09-22 16:57 -0400

csiph-web