Basic class help
Posted: Thu Jan 31, 2008 3:18 pm
hi all this is for PHP 4.
whats wrong with this
I get the error "Ivalid Expression" both in the included class and obviouslly the calling variable "$myVar". how come it does not return the word "HELLO" ?
thanks in advance,
mcm
whats wrong with this
Code: Select all
<?php
class TestClass{
var $test = "HELLO!";
function returnValue(){
return $test;
}
}
?>
//calling from another page
<?php
include 'Testclass.php';
if(isset($_POST['Submit'])) {
$mytest = new TestClass();
$myVar = $mytest->returnValue();
echo $myVar;
}
?>
thanks in advance,
mcm