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 #171210 is a reply to message #171191] Wed, 29 December 2010 15:02 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
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
[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: Sat Nov 23 02:30:35 GMT 2024

Total time taken to generate the page: 0.05003 seconds