Page 1 of 1

using a variable from a separate file without using import

Posted: Thu Jun 10, 2010 10:25 pm
by Smudly
I have created a file called onlineusers.php that figures out how many users there currently are online. At the end of the script is a variable that captures the final number. I want to be able to use ONLY this variable in a separate file called members.php

How do I go about doing something like this?

Re: using a variable from a separate file without using impo

Posted: Thu Jun 10, 2010 11:39 pm
by requinix
Move the code that calculates the number into a function in a separate file. Then have both scripts include the file and call the function.