douyi4991 2014-12-10 22:59
浏览 22

为什么POST数组元素没有显示?

I have a form with method post and i have html selection box which is displaying my options. my option value is 'id_service'. When click on the button, it posts the array to auth_insert.php . Here is my form below.

$rvar_service="SELECT id_s,nom_s FROM tablename WHERE company LIKE '%tous%' OR societe LIKE '%me%'";
$var_service = $conn->query($rvar_service);

<form action='filePost.php' method='POST' style='background-color:#FF6600;'>
    <?php if($var_service->num_rows>0){ ?>
     <fieldset>
     <legend><h3>Services déjà Autorisés</h3></legend>
     <select name='nservice[]' size='15'>
     <?php while($var_service_row = $var_service->fetch_assoc()) { 
                echo "<option value=".$var_service_row['id_s'].">".$var_service_row['nom_s']."</option>" ?>     
    <?php } } ?>
    </select>

    <div style='text-align:right;'><input type='submit' value='Autoriser'></div>
    </fieldset>
    </form>

My post file is called auth_insert.php is below. In this file i have posted the variable which print my array. that array variable doesn't print it's elements. i don't where is the problem exist.

session_start();
$code_e=$_SESSION['ecoutant'];  
$id_s = $_POST['nservice']; 

print'<pre>';
print $code_e.'<br/>';
print $id_s;
print'<pre>';
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line