Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在html中检查和获取值并显示_Php - Fatal编程技术网

Php 如何在html中检查和获取值并显示

Php 如何在html中检查和获取值并显示,php,Php,我无法获得价值观 if (isset($_POST['Register'])) { $indexRegValue = $_POST['RegValue']; // value from index page e.g 490 echo '$indexRegValue'; $ipValue = "490"; $lfvalue = 790; $spvalue = 990; if ($ip == $indexRegValue) {

我无法获得价值观

if (isset($_POST['Register'])) {
     $indexRegValue = $_POST['RegValue']; // value from index page e.g 490
     echo '$indexRegValue';
     $ipValue = "490";
     $lfvalue = 790;
     $spvalue = 990;
     if ($ip == $indexRegValue) {
         $titlevalue = "490";
     } else if ($lfvalue === $indexRegValue) {
         $title = "790";
     } else if ($spvalue === $indexRegValue) {
         $titlevalue = "990";
     }
}
echo $titlevalue; // value to print
如何在html中检查和获取值并显示

您在$ip而不是od$ipValue中有打字错误


您正在检查和打印的变量中存在打字错误

$\u POST['RegValue'];//索引页中的值,例如490 indexRegvalue等于490还是490?您是指$titlevalue而不是第一个else if中的$title?为什么在比较中要在相等和相同之间切换?是的,它的$titlevalue和$ip==$indexRegValueregvalue来自隐藏的输入Hanks,我比较了错误的值,所以为什么没有显示结果,谢谢大家
if (isset($_POST['Register'])) {
     $indexRegValue = $_POST['RegValue']; // value from index page e.g 490
     echo '$indexRegValue';
     $ipValue = "490";
     $lfvalue = 790;
     $spvalue = 990;
     if ($ipValue == $indexRegValue) {// your typo mistake
         $titlevalue = "490";
     } else if ($lfvalue == $indexRegValue) {//changes
         $titlevalue = "790";// your typo mistake
     } else if ($spvalue == $indexRegValue) {//changes
         $titlevalue = "990";
     }
}
echo $titlevalue; // value to print
    if (isset($_POST['Register'])) {
    $indexRegValue = $_POST['RegValue']; // value from index page e.g 490
    echo '$indexRegValue';
    $ipValue = "490";
    $lfvalue = 790;
    $spvalue = 990;
    if ($ipValue == $indexRegValue) {      // corrected variable
       $titlevalue = "490";
                                 } 
    else if ($lfvalue == $indexRegValue) {  
     $titlevalue = "790";          // Corrected variable
                                     } 
   else if ($spvalue == $indexRegValue) {   //changes
     $titlevalue = "990";
                                     }
                           }
   echo $titlevalue; // value to print