Closed Thread
Results 1 to 5 of 5

Thread: Howto use global variables

  1. #1
    dirkfirst is offline Programming Expert
    Join Date
    May 2006
    Posts
    354
    Rep Power
    23

    Howto use global variables

    How do I use global variables such as $_POST????

    Here is an example:

    Code:
    $variable "some text";

    function 
    myfunc() {
       print 
    $variable// Does not work


  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    Code:
    $variable "some text";

    function 
    myfunc() {
       global 
    $variable;
       print 
    $variable// Does not work

    that sould do the trick

  4. #3
    Chan is offline Programming Professional
    Join Date
    Jun 2006
    Posts
    205
    Rep Power
    0
    I was having the same problem and was about to post a topic.
    That works.

    Thank you Sidewinder
    Last edited by Chan; 07-15-2006 at 10:20 AM.

  5. #4
    dirkfirst is offline Programming Expert
    Join Date
    May 2006
    Posts
    354
    Rep Power
    23
    Thanks, stupid thing is I knew that already......

  6. #5
    bernkly Guest
    Global variables. Just declare it outside of a local method. This is applied for other computer languages too.

    But it's not a programming wise in such way.
    Last edited by bernkly; 07-15-2006 at 12:26 PM.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. global variables...how to make them
    By alirezan in forum C and C++
    Replies: 1
    Last Post: 09-17-2011, 09:05 AM
  2. Best way to use global variables
    By rabintech in forum C and C++
    Replies: 5
    Last Post: 07-25-2010, 10:33 AM
  3. global variables
    By yellowzelo in forum Java Help
    Replies: 3
    Last Post: 03-08-2010, 04:39 AM
  4. confused about this global variables
    By jwxie518 in forum C and C++
    Replies: 4
    Last Post: 02-17-2009, 07:28 PM
  5. Global variables (SERVER)
    By Jaan in forum PHP Tutorials
    Replies: 0
    Last Post: 03-22-2007, 07:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts