Using a variable from another condition in PHP
I have this code: if(!isset($_GET["act"])) { $display->display("templates/install_main.html"); if(isset($_POST["proceed"])) { $prefix = $_POST["prefix"]; } } if($_GET["act"] == "act") { echo $prefix; } Basically I've made a similar question before, thing is, HOW can I make the variable accessible? please mention if there is any way to do so, even with changing the way it's done (someone told me it's possible with a class but not quite sure how it can be done), or any other way to make it accessible. Thanks! PHP's variable scope is function-level. $prefix would be available in your second if()