$ _POST方法值没有得到 [英] $_POST method values are not getting

查看:73
本文介绍了$ _POST方法值没有得到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,它有两个组合框,每个框都包含yes,没有值。



如果两个框都是,那么在php上执行第1阶段代码

否则,如果一个框值=是,其他框值=否则在PHP代码上执行第1阶段

否则如果一个框值=否且其他框值=是然后在PHP代码上执行第1阶段

否则在php代码上执行第4阶段



但这总是执行第4阶段它没有得到值



我的尝试:



 <!DOCTYPE html> 
< html>
< head>
< meta charset =UTF-8>
< meta name =viewportcontent =width = device-width,initial-scale = 1.0>
< title>管理帐户< / title>
< link rel =stylesheettype =text / csshref =CSS / Style SheetGeneral.css>
< / head>
< body>
< br>< br>< br>

< table background =Images / Back Ground Images / BG1.jpgborder =2align =centerwidth =825height =820>

< th align = center valign = center>

< form action =searchAccount.phpmethod =POST/>

< div class =textcenter1>
< h2>管理帐户< / h2>
< / div>

< br>< br>

< table border =0; align =centerwidth =655height =550>
< tr>
< td>
NIC附件:< select name =NicChk>
< option selected =value =>(新文档?)< / option>
< option value =yes> YES< / option>
< option value =no> NO< / option>
< / select>< / td>
< td>
< input type =filename =Nic_Imgaccept =image / *>
< / td>
< / tr>
< tr>
< td>
注册证书:< select name =RCcheck>
< option selected =value =>(新文档?)< / option>
< option value =yes> YES< / option>
< option value =no> NO< / option>
< / select>< / td>< / td>
< td>
< input type =filename =Reg_Ceraccept =image / *>
< / td>
< / tr>
< tr>
< td>< / td>
< td>
< input align =lefttype =imagesrc =Images / Buttons / button_search.pngalt =buttonname =searchvalue =Searchwidth =110height = 50/>

< / td>
< / tr>
< / table>
< / form>

< / th>
< / table>
< br>< br>

< / body>
< / html>







<?php 
$ con = mysqli_connect(localhost,root,1234,latgsjason);
if(mysqli_connect_error()){
echo连接失败;
}
if(('$ _ POST [NicChk]'==yes)&&('$ _ POST [RCcheck]'==yes))
{
echostange 1;
}
else if(('$ _ POST [F_Name]'==yes)&&('$ _ POST [Address]'==no))
{
echostange 2;
}
else if(('$ _ POST [NicChk]'==no)&&('$ _ POST [RCcheck]'==yes))
{
echostange 3;
}
else if(('$ _ POST [NicChk]'==no)&&('$ _ POST [RCcheck]'==no))
{
echostange 4;
}
其他
{
echostange 4;
}

解决方案

con = mysqli_connect(localhost,root,1234,latgsjason);
if(mysqli_connect_error()){
echo连接失败;
}
if(('


_POST [NicChk]'==yes)&&('


< blockquote> _POST [RCcheck]'==yes))
{
echostange 1;
}
if if(('


i have a form and it has two combo boxes, each boxes are containing yes,no values.

if both boxes are yes then execute stage 1 on php code
else if one box value=yes and other box value = no then execute stage 1 on php code
else if one box value=no and other box value = yes then execute stage 1 on php code
else execute stage 4 on php code

but this always execute stage 4 it is not getting the values

What I have tried:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manage Account</title>
<link rel="stylesheet" type="text/css" href="CSS/Style SheetGeneral.css">
</head>
<body>
<br><br><br>

<table background="Images/Back Ground Images/BG1.jpg" border="2" align="center" width ="825" height="820">

<th align=center valign=center>

<form action="searchAccount.php" method="POST"/>

    <div class="textcenter1">
        <h2>Manage An Account</h2>
    </div>

<br><br>

<table border="0"; align="center" width ="655" height="550" >
<tr>
<td>
NIC Attachment :<select name="NicChk">
                <option selected="" value="">(New Document?)</option>
                <option value="yes">YES</option>
                <option value="no">NO</option>
                </select></td>
<td>
    <input type="file" name="Nic_Img" accept="image/*">
</td>
</tr>
<tr>
<td>
Registration Certificate :  <select name="RCcheck">
                            <option selected="" value="">(New Document?)</option>
                            <option value="yes">YES</option>
                            <option value="no">NO</option>
                            </select></td></td>
<td>
    <input type="file" name="Reg_Cer" accept="image/*">
</td>
</tr>
<tr>
<td></td>
<td>
    <input align="left" type="image" src="Images/Buttons/button_search.png" alt="button" name="search" value="Search" width="110" height="50"/>
 
</td>
</tr>
</table>
</form>

</th>
</table>
<br><br>

</body>
</html>




<?php
$con= mysqli_connect("localhost","root","1234","latgsjason");
if (mysqli_connect_error()){
echo"Failed to Connect";
}
if(('$_POST[NicChk]'=="yes")&&('$_POST[RCcheck]'=="yes"))
{
    echo "stange 1";
}
else if(('$_POST[F_Name]'=="yes")&&('$_POST[Address]'=="no"))
{
    echo "stange 2";
}
else if(('$_POST[NicChk]'=="no")&&('$_POST[RCcheck]'=="yes"))
{
    echo "stange 3";
}
 else if(('$_POST[NicChk]'=="no")&&('$_POST[RCcheck]'=="no"))
{
     echo "stange 4";
}
else
{
    echo "stange 4";
}

解决方案

con= mysqli_connect("localhost","root","1234","latgsjason"); if (mysqli_connect_error()){ echo"Failed to Connect"; } if(('


_POST[NicChk]'=="yes")&&('


_POST[RCcheck]'=="yes")) { echo "stange 1"; } else if(('


这篇关于$ _POST方法值没有得到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆