problem with class variables
Posted: Mon Jul 03, 2006 1:26 pm
im doint something wrong but cant figure what, i have this code and in the 3rd function the class variable lose is content...
thanks in advance
Code: Select all
Class CreatePoll {
var $options_title;
var $options_number;
function page_1() {
}
function page_2() {
echo $this->options_title;
}
function page_3() {
//here just dont work more
echo $this->options_title;
}
$obj_CreatePoll = New CreatePoll;
if (isset($_POST['page1'])){
$obj_CreatePoll->options_title = $_POST['blablka'];
$obj_CreatePoll->page_2();
} elseif(isset($_POST['page2'])) {
$obj_CreatePoll->page_3();
} else {
$obj_CreatePoll->page_1();
}
}