如何将表单从get更改为post


How to change form from get to post?

此表单的链接带有问号:

这是一个文件:sidebar.php

echo
<form method='get'>
    <div class='left'>
     <div class='btn-group-vertical'> 
             <!-- Vertically Stck button group -->
       <button 'submit' name='Service)name' class='btn btn-default'>Service Name</button>
       <button type='submit' name='YYY_Service' class='btn btn-default'>YYY Service</button>
      </div>
      </form>; 
      ?>

这是index.php:的一部分

ini_set('session.save_path','/path/to/session');
session_start();
error_reporting(E_ALL); ini_set('display_errors', 1);
$current_menu='empty.php'; //If no menu/button is selected get right column empty(empty.php)

if(isset($_REQUEST['Service'])){$current_menu='serviceform.php';}
if(isset($_REQUEST['YYY_Service'])){$current_menu='yyyform.php';}

这显示URL,例如:

www.foo.com/index.php?Service=
www.foo.com/index.php?YYY_Service=

应该如何更改此表单以便以这种方式显示URL?

www.foo.com/serviceform.php
www.foo.com/yyyform.php

这个代码在另一个文件中:

function Button_set($name, $newline)
{
   if($newline){
   ?>
    <br><br><input type="button" name="<?=$name?>" value="<?=$name?>" /input>
   <?php
   }
   else if (!$newline){
   ?>
    <input type="button" name="<?=$name?>" value="<?=$name?>" /input>
   <?php
   }
 }  

如果我只将表单方法更改为POST,它就不起作用。。。

更改:

<form method="get">

至:

<form method="post">

还添加属性"行动"到你想要的网站:

<form method="post" action="serviceform.php">
<form method="post" action="yyyform.php">

表单上的W3C链接