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

Home » Imported messages » comp.lang.php » initial value
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: initial value [message #171166 is a reply to message #171160] Tue, 28 December 2010 19:06 Go to previous messageGo to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
On Tue, 28 Dec 2010 09:37:13 -0800 (PST), Captain Paralytic wrote:

> On Dec 28, 5:20 pm, Helmut Chang <use...@helmutchang.at> wrote:
>> Am 28.12.2010 17:30, schrieb richard:
>>
>>> $year=$_GET(yearID)
>>> echo $year
>>
>>> Works just fine except for one thing.
>>
>> Don't think so.
>>
>> 1. $_GET is an array and elements in an array are accessed by square
>>     brackets:
>>
>> $_GET[] not $_GET()
>>
>> 2. As long, as yearID is not defined as constants, but you mean the
>>     string 'yearID', you should use '':
>>
>> $_GET['yearID'] instead of $_GET[yearID]
>>
>>> When the page is initially loaded, there is nothing in the space.
>>> I want to show a year in the space as the default.
>>> So that $year should have a value other than null.
>>> How is that done?
>>
>> In initializing the variable with a default value:
>>
>> $year = 2010;
>>
>> if (isset($_GET['yearID']))
>>    $year = $_GET['yearID'];
>>
>> Helmut
>
> Ahh but Richard and that other rather famous lady JRough don't program
> in normal php. They use the infinite monkeys variant. That's the one
> where you type random characters and hope that eventually a working
> php program will be produced.

Before I go asking questions here, I do tons of research. Do you know what
a bitch it is looking for a simple answer through google? Weeding through
hundreds of links that wind up having nothing to my benefit?

Oh, but you're the expert and never ask questions.

Even expert mechanics who work on multimillion dollar race cars carry
manuals with them. Why? In case they don't have the immediate answer in
their brain.
[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
Previous Topic: Problem Connecting to PHP
Next Topic: Open Session Variables
Goto Forum:
  

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

Current Time: Sun Nov 24 03:32:33 GMT 2024

Total time taken to generate the page: 0.04079 seconds