FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » using same variable twice on same page
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: using same variable twice on same page [message #171209 is a reply to message #171205] Wed, 29 December 2010 15:00 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
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
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: AND in the if statement
Next Topic: login script using file, not mysql
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 13:58:33 GMT 2024

Total time taken to generate the page: 0.05788 seconds