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; default: fuction_2(); break; }

php post self

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -