|
|
|
|
|
|
Re: using same variable twice on same page [message #171205 is a reply to message #171202] |
Wed, 29 December 2010 14:15   |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Dec 29, 1:21 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 12/29/2010 12:07 AM, richard wrote:
>
>
>
>
>
>> Everything I have looked at so far talks of how to use one variable ONCE!
>> Nothing I've seen even comes to close as to how to utilize the same
>> variable in a different location on the same page.
>
>> for instance:
>> initial value of $year="1960"
>> <div> <?php echo $year;?></div>
>> <div> blah blah blah</div>
>> <div> yada yada yada</div>
>> Assume here we change $year to be "1961"
>> <div> <?php if ($year="1961") echo $year; ?></div>
>
>> From what I've tried, no change is made.
>> Even if I use a second instance of $_GET().
>
>> What is the best way of doing what I want to happen?
>
>> As you know, google is a hodge podge for looking up something with more
>> than one word in the search bar.
>
> Richard, you really need to get a good book on php. Trying to
> haphazardly search the internet doesn't work well. And while php.net is
> a good reference, I don't find it to be a good learning tool. Please
> save yourself a lot of heartache and spend a few dollars for a good book
> to help you learn.
>
> As for your question - you're confusing '=' and '=='. There is a
> difference.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
In the year since Richard has been regularly posting, I would have
expected him to have at least run through http://www.w3schools.com/php/default.asp
and/or http://www.tizag.com/phpT/
and to have obtained a basic knowledge of the syntax of php.
Now either he has not had the intelligence to have searched for php
tutorials, or he has done them but has not had the intelligence to
understand anything he has done.
Either way, telling him to buy a book on php is a rather cruel way of
wasting his money.
I've suggested before that he and JRough should go into partnership.
They could have endless fun together hitting random keys and
pretending that they are programming.
I'm sorry if this seems rude, but it is fairly obvious that some
people simply do not have the aptitude for programming and I think it
far better to let them know this so that they can go off and try
something else.
|
|
|
Re: using same variable twice on same page [message #171209 is a reply to message #171205] |
Wed, 29 December 2010 15:00   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 12/29/2010 9:15 AM, Captain Paralytic wrote:
> On Dec 29, 1:21 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 12/29/2010 12:07 AM, richard wrote:
>>
>>
>>
>>
>>
>>> Everything I have looked at so far talks of how to use one variable ONCE!
>>> Nothing I've seen even comes to close as to how to utilize the same
>>> variable in a different location on the same page.
>>
>>> for instance:
>>> initial value of $year="1960"
>>> <div> <?php echo $year;?></div>
>>> <div> blah blah blah</div>
>>> <div> yada yada yada</div>
>>> Assume here we change $year to be "1961"
>>> <div> <?php if ($year="1961") echo $year; ?></div>
>>
>>> From what I've tried, no change is made.
>>> Even if I use a second instance of $_GET().
>>
>>> What is the best way of doing what I want to happen?
>>
>>> As you know, google is a hodge podge for looking up something with more
>>> than one word in the search bar.
>>
>> Richard, you really need to get a good book on php. Trying to
>> haphazardly search the internet doesn't work well. And while php.net is
>> a good reference, I don't find it to be a good learning tool. Please
>> save yourself a lot of heartache and spend a few dollars for a good book
>> to help you learn.
>>
>> As for your question - you're confusing '=' and '=='. There is a
>> difference.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> In the year since Richard has been regularly posting, I would have
> expected him to have at least run through http://www.w3schools.com/php/default.asp
> and/or http://www.tizag.com/phpT/
> and to have obtained a basic knowledge of the syntax of php.
>
> Now either he has not had the intelligence to have searched for php
> tutorials, or he has done them but has not had the intelligence to
> understand anything he has done.
>
> Either way, telling him to buy a book on php is a rather cruel way of
> wasting his money.
>
> I've suggested before that he and JRough should go into partnership.
> They could have endless fun together hitting random keys and
> pretending that they are programming.
>
> I'm sorry if this seems rude, but it is fairly obvious that some
> people simply do not have the aptitude for programming and I think it
> far better to let them know this so that they can go off and try
> something else.
I don't know, Paul. You may be right. I've had students in my classes
before who are completely lost even on simple non-language specific
pseudo-code examples. However, others have started out badly, and with
the right tools, have succeeded.
Personally, I don't think w3schools is all that great a learning tool.
It's ok for some stuff, but pretty shallow in their coverage of most
stuff. As for tizag.com - heck, I've never run into that one, either.
I'll have to take a look at it.
But it's obvious Richard is trying, and isn't going to give up. So if I
can point him in a direction which will help him better than newsgroups
do (usenet isn't good for everything!), I will.
And as for his problem - it's a common one I see all the time in my
classes, even from more experienced programmers, and one I make with
embarrassing regularity myself :)
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: using same variable twice on same page [message #171210 is a reply to message #171191] |
Wed, 29 December 2010 15:02   |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 29/12/10 05:07, richard wrote:
> Everything I have looked at so far talks of how to use one variable ONCE!
> Nothing I've seen even comes to close as to how to utilize the same
> variable in a different location on the same page.
>
> for instance:
> initial value of $year="1960"
> <div> <?php echo $year;?></div>
> <div> blah blah blah </div>
> <div> yada yada yada </div>
> Assume here we change $year to be "1961"
> <div> <?php if ($year="1961") echo $year; ?></div>
>
> From what I've tried, no change is made.
Then whatever code you have at 'Assume here we change $year to be
"1961"' is, to use the appropriate technical term, fucked code, and you
need to fix it.
> Even if I use a second instance of $_GET().
1) You've already been told that $_GET is an array, not a function call,
and that you must use $_GET[some_fieldname_in_quotes] rather than
$_GET(some_random_text). If you can not absorb this simple bit of
information, you will never learn to code in php, so you should stop
trying now.
2) I don't see a first instance of a "$_GET['some_field_name']" or even
a richard_fucked "$_GET(something)" in the example code you offered, so
I have no idea what you mean when you say the problem occurs even if you
use a second instance of $_GET().
Rgds
Denis McMahon
|
|
|
Re: using same variable twice on same page [message #171211 is a reply to message #171205] |
Wed, 29 December 2010 15:05   |
Luuk
Messages: 329 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 29-12-10 15:15, Captain Paralytic wrote:
> On Dec 29, 1:21 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 12/29/2010 12:07 AM, richard wrote:
>>
>>
>>
>>
>>
>>> Everything I have looked at so far talks of how to use one variable ONCE!
>>> Nothing I've seen even comes to close as to how to utilize the same
>>> variable in a different location on the same page.
>>
>>> for instance:
>>> initial value of $year="1960"
>>> <div> <?php echo $year;?></div>
>>> <div> blah blah blah</div>
>>> <div> yada yada yada</div>
>>> Assume here we change $year to be "1961"
>>> <div> <?php if ($year="1961") echo $year; ?></div>
>>
>>> From what I've tried, no change is made.
>>> Even if I use a second instance of $_GET().
>>
>>> What is the best way of doing what I want to happen?
>>
>>> As you know, google is a hodge podge for looking up something with more
>>> than one word in the search bar.
>>
>> Richard, you really need to get a good book on php. Trying to
>> haphazardly search the internet doesn't work well. And while php.net is
>> a good reference, I don't find it to be a good learning tool. Please
>> save yourself a lot of heartache and spend a few dollars for a good book
>> to help you learn.
>>
>> As for your question - you're confusing '=' and '=='. There is a
>> difference.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> In the year since Richard has been regularly posting, I would have
> expected him to have at least run through http://www.w3schools.com/php/default.asp
> and/or http://www.tizag.com/phpT/
> and to have obtained a basic knowledge of the syntax of php.
>
> Now either he has not had the intelligence to have searched for php
> tutorials, or he has done them but has not had the intelligence to
> understand anything he has done.
Since when do you care about the intelligence of anyone else?
He definitely wants to learn, otherwise he would not post a question here.
>
> Either way, telling him to buy a book on php is a rather cruel way of
> wasting his money.
Its HIS money, not yours
>
> I've suggested before that he and JRough should go into partnership.
> They could have endless fun together hitting random keys and
> pretending that they are programming.
Spamming someone else's name is not very polite. Especially because this
person has no (direct) reference to this thread.
>
> I'm sorry if this seems rude, but it is fairly obvious that some
> people simply do not have the aptitude for programming and I think it
> far better to let them know this so that they can go off and try
> something else.
I dont think you ARE sorry.
If you really think he's not able to learn some programming, than you
could also simply ignore his messages, which saves you your 'valuable'
time, and saves some other people a lot of frustration.
--
Luuk
|
|
|
|
|
Re: using same variable twice on same page [message #171214 is a reply to message #171212] |
Wed, 29 December 2010 15:21   |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 29/12/10 15:10, Evan Platt wrote:
> On Wed, 29 Dec 2010 08:19:57 -0500, Jerry Stuckle
> <jstucklex(at)attglobal(dot)net> wrote:
>
>> On 12/29/2010 6:25 AM, Thomas 'PointedEars' Lahn wrote:
>>> Adrienne Boswell wrote:
>>>
>>>> richard [wrote]:
>>>> > Everything I have looked at so far talks of how to use one variable
>>>> ONCE!
>>> ^^
>>> Please get a decent newsreader that does not produce broken quotes.
>>>
>>
>> There is nothing wrong with his newsreader. If you see broken quotes,
>> you need to check YOUR newsreader.
>
> I see broken quotes too, and I've disabled all forms of word wrap.
>
> Do you not see
>
>> Everything I have looked at so far talks of how to use one variable
> ONCE!
I looked at the message source, and there's a newline before "ONCE!",
but no quote character after the newline. I'd call that broken quoting
myself.
Whether it was broken by the newsreader or some action of the poster is
moot - if the poster manually inserted the newline and didn't add a
quote character it was user action, not a broken newsreader, that led to
the broken quoting.
Rgds
Denis McMahon
|
|
|
Re: using same variable twice on same page [message #171215 is a reply to message #171202] |
Wed, 29 December 2010 15:57   |
 |
richard
 Messages: 213 Registered: June 2013
Karma: 0
|
Senior Member |
|
|
On Wed, 29 Dec 2010 08:21:45 -0500, Jerry Stuckle wrote:
> On 12/29/2010 12:07 AM, richard wrote:
>> Everything I have looked at so far talks of how to use one variable ONCE!
>> Nothing I've seen even comes to close as to how to utilize the same
>> variable in a different location on the same page.
>>
>> for instance:
>> initial value of $year="1960"
>> <div> <?php echo $year;?></div>
>> <div> blah blah blah</div>
>> <div> yada yada yada</div>
>> Assume here we change $year to be "1961"
>> <div> <?php if ($year="1961") echo $year; ?></div>
>>
>> From what I've tried, no change is made.
>> Even if I use a second instance of $_GET().
>>
>> What is the best way of doing what I want to happen?
>>
>> As you know, google is a hodge podge for looking up something with more
>> than one word in the search bar.
>
> Richard, you really need to get a good book on php. Trying to
> haphazardly search the internet doesn't work well. And while php.net is
> a good reference, I don't find it to be a good learning tool. Please
> save yourself a lot of heartache and spend a few dollars for a good book
> to help you learn.
>
> As for your question - you're confusing '=' and '=='. There is a
> difference.
Jerry, I bought the PHP 5 bible ok? Like most of these damn things, it is
so filled with gobly gook only a trained technician could understand.
Several times he spends 10 pages on crap that has no relation to anything
any person programming needs to know.
And for you captain pukehead, I constantly read through php.net, tizag, and
a host of others.
|
|
|
|
|
Re: using same variable twice on same page [message #171218 is a reply to message #171215] |
Wed, 29 December 2010 16:53   |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Dec 29, 3:57 pm, richard <mem...@newsguy.com> wrote:
> On Wed, 29 Dec 2010 08:21:45 -0500, Jerry Stuckle wrote:
>> On 12/29/2010 12:07 AM, richard wrote:
>>> Everything I have looked at so far talks of how to use one variable ONCE!
>>> Nothing I've seen even comes to close as to how to utilize the same
>>> variable in a different location on the same page.
>
>>> for instance:
>>> initial value of $year="1960"
>>> <div> <?php echo $year;?></div>
>>> <div> blah blah blah</div>
>>> <div> yada yada yada</div>
>>> Assume here we change $year to be "1961"
>>> <div> <?php if ($year="1961") echo $year; ?></div>
>
>>> From what I've tried, no change is made.
>>> Even if I use a second instance of $_GET().
>
>>> What is the best way of doing what I want to happen?
>
>>> As you know, google is a hodge podge for looking up something with more
>>> than one word in the search bar.
>
>> Richard, you really need to get a good book on php. Trying to
>> haphazardly search the internet doesn't work well. And while php.net is
>> a good reference, I don't find it to be a good learning tool. Please
>> save yourself a lot of heartache and spend a few dollars for a good book
>> to help you learn.
>
>> As for your question - you're confusing '=' and '=='. There is a
>> difference.
>
> Jerry, I bought the PHP 5 bible ok? Like most of these damn things, it is
> so filled with gobly gook only a trained technician could understand.
> Several times he spends 10 pages on crap that has no relation to anything
> any person programming needs to know.
>
> And for you captain pukehead, I constantly read through php.net, tizag, and
> a host of others.
And there is my point. If you have constantly read this stuff and you
still do not understand the basic syntax of php, then there really is
no hope for you.
But since I note that you have started calling me names that I would
expect to hear from kindergarten age children, maybe the problem is
simply that you haven't grown up.
|
|
|
|
Re: using same variable twice on same page [message #171221 is a reply to message #171214] |
Wed, 29 December 2010 17:11   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 12/29/2010 10:21 AM, Denis McMahon wrote:
> On 29/12/10 15:10, Evan Platt wrote:
>> On Wed, 29 Dec 2010 08:19:57 -0500, Jerry Stuckle
>> <jstucklex(at)attglobal(dot)net> wrote:
>>
>>> On 12/29/2010 6:25 AM, Thomas 'PointedEars' Lahn wrote:
>>>> Adrienne Boswell wrote:
>>>>
>>>> > richard [wrote]:
>>>> >> Everything I have looked at so far talks of how to use one variable
>>>> > ONCE!
>>>> ^^
>>>> Please get a decent newsreader that does not produce broken quotes.
>>>>
>>>
>>> There is nothing wrong with his newsreader. If you see broken quotes,
>>> you need to check YOUR newsreader.
>>
>> I see broken quotes too, and I've disabled all forms of word wrap.
>>
>> Do you not see
>>
>>> Everything I have looked at so far talks of how to use one variable
>> ONCE!
>
> I looked at the message source, and there's a newline before "ONCE!",
> but no quote character after the newline. I'd call that broken quoting
> myself.
>
> Whether it was broken by the newsreader or some action of the poster is
> moot - if the poster manually inserted the newline and didn't add a
> quote character it was user action, not a broken newsreader, that led to
> the broken quoting.
>
> Rgds
>
> Denis McMahon
And that's worth bitching about? I guess it is to Pointed Head - if he
couldn't troll he'd have nothing to say.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: using same variable twice on same page [message #171223 is a reply to message #171215] |
Wed, 29 December 2010 17:21   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 12/29/2010 10:57 AM, richard wrote:
> On Wed, 29 Dec 2010 08:21:45 -0500, Jerry Stuckle wrote:
>
>> On 12/29/2010 12:07 AM, richard wrote:
>>> Everything I have looked at so far talks of how to use one variable ONCE!
>>> Nothing I've seen even comes to close as to how to utilize the same
>>> variable in a different location on the same page.
>>>
>>> for instance:
>>> initial value of $year="1960"
>>> <div> <?php echo $year;?></div>
>>> <div> blah blah blah</div>
>>> <div> yada yada yada</div>
>>> Assume here we change $year to be "1961"
>>> <div> <?php if ($year="1961") echo $year; ?></div>
>>>
>>> From what I've tried, no change is made.
>>> Even if I use a second instance of $_GET().
>>>
>>> What is the best way of doing what I want to happen?
>>>
>>> As you know, google is a hodge podge for looking up something with more
>>> than one word in the search bar.
>>
>> Richard, you really need to get a good book on php. Trying to
>> haphazardly search the internet doesn't work well. And while php.net is
>> a good reference, I don't find it to be a good learning tool. Please
>> save yourself a lot of heartache and spend a few dollars for a good book
>> to help you learn.
>>
>> As for your question - you're confusing '=' and '=='. There is a
>> difference.
>
> Jerry, I bought the PHP 5 bible ok? Like most of these damn things, it is
> so filled with gobly gook only a trained technician could understand.
> Several times he spends 10 pages on crap that has no relation to anything
> any person programming needs to know.
>
> And for you captain pukehead, I constantly read through php.net, tizag, and
> a host of others.
Actually, Richard, I've seen that book. It's a pretty decent
programming book. There is nothing in it a programmer shouldn't know.
As for having to be a "trained technician" - I haven't seen anything in
there requiring such expertise. It does, however, require a logical mind
and understanding of some very basic concepts - concepts every
successful programmer must know (like what is a "byte"?).
I'm sorry you think it's such a poor book - but you can't get a whole
lot better.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
|
|
|
|
|
|
|
Re: using same variable twice on same page [message #171310 is a reply to message #171270] |
Thu, 30 December 2010 09:24   |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
Captain Paralytic wrote:
> On Dec 29, 10:53 pm, Tim Streater <timstrea...@waitrose.com> wrote:
>> In article <yzhlacpa809x....@evanplatt.sux>,
>>
>> richard <mem...@newsguy.com> wrote:
>>> Everything I have looked at so far talks of how to use one variable ONCE!
>>> Nothing I've seen even comes to close as to how to utilize the same
>>> variable in a different location on the same page.
>>> for instance:
>>> initial value of $year="1960"
>>> <div> <?php echo $year;?></div>
>>> <div> blah blah blah </div>
>>> <div> yada yada yada </div>
>>> Assume here we change $year to be "1961"
>>> <div> <?php if ($year="1961") echo $year; ?></div>
>> You have a typo in the line above.
> Not according to Richard. He says that it is php.net that is wrong. He
> can type whatever he likes. If the manual doesn't say that what he
> typed is correct, it is the manual's fault.
Took me over a day when I first tried to write assembler, to realise
that the (paper) manual had indented the code, but that the assembler
refused to accept any line beginning with white space and silently
ignored them.
I assumed from the manual, the white space was a necessary thing to
include...
This being 1982 or thereabouts, and the first micro anyone I knew had
ever seen, who could one ask?
|
|
|
|
|
|
|
|
|
|
Re: OT: Assignment operator (Was: using same variable twice on same page) [message #171358 is a reply to message #171344] |
Thu, 30 December 2010 19:21   |
 |
richard
 Messages: 213 Registered: June 2013
Karma: 0
|
Senior Member |
|
|
On Thu, 30 Dec 2010 15:35:10 +0100, August Karlstrom wrote:
> On 2010-12-30 05:47, Jerry Stuckle wrote:
>> On 12/29/2010 8:07 PM, August Karlstrom wrote:
>>> On 2010-12-29 11:42, Derek Turner wrote:
>>>> On Tue, 28 Dec 2010 22:07:55 -0700, richard wrote:
>>>>
>>>> > <?php if ($year="1961")
>>>>
>>>> This simply sets $year to "1961" and will always return 'true'
>>>
>>> ...which is more or less a flaw in the language design copied from C.
>>
>> Not at all. == is a completely different operator than =. Just like ++
>> is not the same as +.
>
> The equal sign `=' has been used in mathematics since medieval times to
> denote equality. To use `==' for equality and `=' for something else
> (assignment) is not sensible.
>
>
> /August
Not really. As in various programming languages dictate, usage and display
can be quite different.
In BASIC and simpler low level languages, we say <>, meaning "not equal"
while in the higher level languages we say, !=.
|
|
|
Re: OT: Assignment operator (Was: using same variable twice on same page) [message #171360 is a reply to message #171358] |
Thu, 30 December 2010 19:45   |
August Karlstrom
Messages: 16 Registered: October 2010
Karma: 0
|
Junior Member |
|
|
On 2010-12-30 20:21, richard wrote:
> On Thu, 30 Dec 2010 15:35:10 +0100, August Karlstrom wrote:
>> The equal sign `=' has been used in mathematics since medieval times to
>> denote equality. To use `==' for equality and `=' for something else
>> (assignment) is not sensible.
>
> Not really. As in various programming languages dictate, usage and display
> can be quite different.
>
> In BASIC and simpler low level languages, we say<>, meaning "not equal"
> while in the higher level languages we say, !=.
The symbols `/=' and `#' are also used in some high-level languages. It
is unfortunate that the not-equal-to sign is neither on a standard
keyboard nor in the 7-bit ASCII table. As a general guideline, however,
I don't think language designers should redefine the meaning of well
known symbols from mathematics. Or why not let `+' be the
increment-by-one operator and `++' denote addition? Why not? After all,
as Jerry Stuckle mentioned, programming is not mathematics.
/August
--
The competent programmer is fully aware of the limited size of his own
skull. He therefore approaches his task with full humility, and avoids
clever tricks like the plague. --Edsger Dijkstra
|
|
|
|
|