Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-2006, 07:22 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default Howto use global variables

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

Here is an example:

PHP Code:
$variable "some text";

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

__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-13-2006, 11:42 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

PHP Code:
$variable "some text";

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

that sould do the trick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-14-2006, 10:03 AM
Chan Chan is offline
Programming Professional
 
Join Date: Jun 2006
Posts: 205
Rep Power: 10
Chan is on a distinguished road
Default

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 01:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-15-2006, 02:49 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default

Thanks, stupid thing is I knew that already......
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-15-2006, 03:19 PM
bernkly's Avatar   
bernkly bernkly is offline
Newbie
 
Join Date: Jul 2006
Posts: 15
Rep Power: 9
bernkly is on a distinguished road
Default

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.
__________________
Timemsg - Send self destruct message.

Last edited by bernkly; 07-15-2006 at 03:26 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Global warming target7 The Lounge 7 08-22-2007 12:32 PM
C- Syntax to allocate Global variables to consecutive memory locations techie82 C and C++ 1 04-09-2007 12:42 PM
Global variables (SERVER) Jaan PHP Tutorials 0 03-22-2007 10:43 PM
Variables clookid PHP Tutorials 1 01-11-2007 09:40 PM
Variables Sionofdarkness Java Help 4 08-21-2006 03:32 PM


All times are GMT -5. The time now is 07:20 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads