PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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;
}
?>
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