Alright, might wanna sit down for this one, lengthy problem, most likely requiring a short answer :queasy:
Here we go...
Here is an example of what I am trying to achieve.
test.php
<?php
require_once("test2.php");
class Test {
var $OurVar;
function setVar($newVar){
$this->OurVar = $newVar;
}
function doIt(){
$blah = 1;
while($blah == 1){
$blah = $blah -1;
$num = 6;
echo $this->OurVar;
}
}
}
$testoid = new Test;
$testoid->setVar($var);
$testoid->doIt();
?>
test2.php
<?php
$var = "The number is " . $num;
?>
You can see from the code what I'm trying to do. I need to carry a variable over from another file and have it keep it's variables (if that makes sense).
The above, test.php, will output:
The number is
I know there is some kind of way, I've google'd it, manual'd it, but can't find anything on it.
Please... any suggestions welcome.
Thanks,
Stewart