php - work with PHP_SELF -
php - work with PHP_SELF - it give me error : undefined index: action in line : $act=$_post['action']; <?php function_2() { ?> <form name="poll" method="post" action="<?php echo $_server['php_self']; ?>"> <input type="hidden" name="action" value="insert"> . . . </form> <?php } $act=$_post['action']; switch($act) { case "insert": function_1(); break; default: fuction_2(); break; } ?> please help me it. that error saying $_post['action'] doesn't exist. so, need conditional statement set value of $act. // set default $act = ''; if ( isset($_post['action'])) ) { $act = $_post['action']; } switch($act) { case "insert": function_1(); break...