简单的形式错误

时间:2014-06-27 03:10:22

标签: php html css

我有这个表格,应该带我到online-payment.php,但有GET值,但当我点击提交我得到在线PHP但有这个链接,我似乎不知道为什么:/

http://localhost/ereserve/online-payment.php?

如你所见,之后什么都没有?所以get值不会在URL中编码。

我不知道我的错误在哪里

显示所有项目,因此查询和php正在运行。

只是不对网址进行编码

  <form method="GET" action="./online-payment" >
                    <p style="margin-top:150px;margin-left:100px;">Available Time:</p>
                    <select style="clear:both; width:300px;margin-left:100px;">
                <option></option>

                <?php
                     $b= "SELECT * FROM timeslots,tables Where tables.rid != 'reservation.rid' AND 'tables.tid' != 'reservation.tid' AND 'timeslots.tid' != 'reservation.timeid' ORDER BY timeslotid;"; 
                     $query = mysql_query($b);
                     while ($c= mysql_fetch_row($query))
                     {
                         $timeslotid=$c[0];

                         $timeframe=$c[1];
                         $tid = $c[2];
                         $size=$c[3];
                         $number=$c[4];

                 ?>                                             

                        <option value="<?php echo $timeslotid?>" >
                            <?php echo $timeframe; ?>
                        </option>

                                    <?php  }  ?> 

                    </select>



                    <p style="margin-left:100px;">Table Size:</p>

                        <select style="clear:both; width:300px;margin-left:100px;">
                <option></option>

                <?php
                     $b= "SELECT DISTINCT size FROM timeslots,tables Where tables.rid != 'reservation.rid' AND 'tables.tid' != 'reservation.tid' AND 'timeslots.tid' != 'reservation.timeid' ORDER BY timeslotid;"; 
                     $query = mysql_query($b);
                     while ($c= mysql_fetch_row($query))
                     {
                         $size=$c[0];
                 ?>                                             

                        <option value="<?php echo $size?>">
                            <?php echo $size; ?>
                        </option>

                                    <?php  }  ?> 

                    </select>



                        <p style="margin-left:100px;">Purpose</p>
                        <select style="clear:both; width:300px;margin-left:100px;">
                            <option></option>
                            <option value="No">No Special Purpose</option>
                            <option value="birthday">Birthday</option>
                            <option value="meeting">Meeting</option>
                        </select>


                        <div class="rmenu">

                                    <?php 
                                    $b= "Select * from menuitem where mid=(Select menuid from menu where rid= $rid)"; 
                     $query = mysql_query($b);
                     while ($c= mysql_fetch_row($query))
                     {
                         $id=$c[0];

                         $name=$c[1];
                         $category = $c[2];
                         $price=$c[3];
                         $pic=$c[4];
                         $description=$c[5];

                 ?>          
                                        <div class="menuitem">
                                            <img src="<?php echo $pic; ?> " />
                                             <p><strong> Name: </strong> <?php echo $name ?> </p>
                                            <p><strong> Category: </strong><?php echo $category ?> </p>
                                            <p><strong> Price: </strong> <?php echo $price ?> $</p>
                                            <p><strong> Description: </strong> <?php echo $description ?> </p>
                                            Add to Order : <input type="checkbox" value="<?php echo $id ?>" >
                                        </div>
                                             <?php } ?>
                         </div>
                          <input type="submit" value="Submit" style="width:100px;margin-left:100px;height:50px;float:left;" />    
             </form>

3 个答案:

答案 0 :(得分:2)

在您的元素上添加name属性,而不只是value属性。

答案 1 :(得分:0)

可能就像

一样简单
<form method="GET" action="./online-payment" > 

更新为阅读

  <form method="GET" action="./online-payment.php" >

答案 2 :(得分:0)

试过这个。

<form action="test">
    <input type="text" value="" name="somename" />
    <input type="submit" value="submit" name="test" />
 </form>

这导致了这种网址

http://localhost/directory/test?somename=value&test=

如果您没有提及表单方法,默认情况下,表单方法将是GET本身。