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!
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();
}
}
All of the class variables (properties) will "lose" their values every request. You would need to store the object or some vars in the session or pass the extra values through each form as hidden inputs.