php - Form button to redirect user to specific page -


i have function on page takes user page if action equal 'add'. want create button me without typing &action=add url.

the function looks this:

 function consultants_page() {     if (isset($_get['action']) && $_get['action'] == 'add') {        require( get_template_directory() . '/settings/pages/consultant_add.php' );      }else {         require( get_template_directory() . '/settings/pages/consultant.php');     } } 

i need amend button link function, isn't working..

<form method="get" action="add"> <p class="submit"><input type="submit" name="add" id="submit" class="button button-primary" value="add"></p> </form> 

cheers

something send variable "action" url:

<form method="get" > <p class="submit"><input type="submit" name="action" id="submit" class="button button-primary" value="add"></p>  </form> 

with html sending add?add=add.

your php code should variable $_get["action"].


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -