Forums

PHP

This topic is locked

Function declaration, anywhere in file?

Posted 08 Apr 2002 05:04:14
1
has voted
08 Apr 2002 05:04:14 chris chris posted:
I have been reading up on php code.
I understand how to declare functions but is there any requirement that says where in the code they must be in order to use them?

Basically, I can't call myfuntion if it's not declared yet, right?

Thanks

Replies

Replied 09 Apr 2002 22:25:59
09 Apr 2002 22:25:59 Tim Green replied:
You can put your function anywhere on the page. It doesn't matter if the function comes before or after the call, as long as it exists on the page.

Hope this helps.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 10 Apr 2002 02:52:03
10 Apr 2002 02:52:03 chris chris replied:
I'm new to PHP so I don't really even know how to put in the code necessary.

I thought I would try something simple. So just above the "if (isset($MM_insert))"

I put in hdnWeeknum=99 This produces and error. My hmtl hidden form field is hdnWeekNum

Please help if you can

Reply to this topic