dongwopu8210 2016-05-19 12:14
浏览 12

如何从表格改为表格?

the links of this form have question marks:

This is a file: 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>; 
      ?>

This is a part of 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';}

This is showing URLS such as:

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

How should this form changed in order to show instead urls this way?

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

And this code in another file:

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
   }

 }  

If I only change the form method to POST it doesn't work...

  • 写回答

1条回答 默认 最新

  • doulaozhang0238 2016-05-19 12:22
    关注

    Change:

    <form method="get">
    

    to:

    <form method="post">
    

    Also add attribute "action" to site you want:

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

    W3C link on form

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么