Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.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
Javascript Php:不能使用好的表单_Javascript_Php_Mysql - Fatal编程技术网

Javascript Php:不能使用好的表单

Javascript Php:不能使用好的表单,javascript,php,mysql,Javascript,Php,Mysql,对不起,我拼错了 嗨,我想制作一个显示互联网没收的网站,所以在mySQL数据库中,我把我所有的信息放在我的网页上,然后打印出来,用户点击他想要的没收,它会把他带到另一个显示所有没收信息的页面。。。在while()中,我为每次没收制作了唯一的表单,然后在 这里的问题是,sumbited的唯一表单是最后创建的表单 include_once "DataBase/db.php"; if($internet->num_rows != 0){

对不起,我拼错了

嗨,我想制作一个显示互联网没收的网站,所以在mySQL数据库中,我把我所有的信息放在我的网页上,然后打印出来,用户点击他想要的没收,它会把他带到另一个显示所有没收信息的页面。。。在while()中,我为每次没收制作了唯一的表单,然后在 这里的问题是,sumbited的唯一表单是最后创建的表单

   include_once "DataBase/db.php";

            if($internet->num_rows != 0){
                    while($rows = $internet->fetch_assoc()){
                        $nom = $rows["nom"];
                        $id = $rows["id"];
                        $tech = $rows["technologie"];
                        $telechargement = $rows["telechargement"];
                        $televersement = $rows["televersement"];
                        $utilisation = $rows["utilisation"];
                        $prix= $rows["prix"];

                       echo '
           <form method="POST" action="Fournisseurs/Videotron.php" id="'.$id.'">

              <div class="boxes">
               <div class="[ price-option price-option--high ]">
                <div class="price-option__detail">
                   <span class="price-option__cost">'.$nom.'<br>$'.$prix.'</span>
                    </div>

                     <input type="hidden" name="id" value="'.$id.'"></input>
                     <input type="hidden" name="nom" value="'.$nom.'"></input>
                     <input type="hidden" name="tech" value="'.$tech.'"></input>
                     <input type="hidden" name="telechargement" value="'.$telechargement.'"></input>
                     <input type="hidden" name="televersement" value="'.$televersement.'"></input>
                     <input type="hidden" name="utilisation" value="'.$utilisation.'"></input>
                     <input type="hidden" name="prix" value="'.$prix.'"></input>

                       <div class="price-option__purchase">
                         <a href="javascript:document.getElementById('.$id.').submit();"> Submit </a>
                       </div>
                        </div>
                        </div>
                    ';
                           }
        }
include_once“DataBase/db.php”;
如果($internet->num_rows!=0){
而($rows=$internet->fetch_assoc()){
$nom=$rows[“nom”];
$id=$rows[“id”];
$tech=$rows[“technie”];
$telechargement=$rows[“telechargement”];
$televersement=$rows[“televersement”];
$提款=$行[“提款”];
$prix=$rows[“prix”];
回声'
“.$nom.”
$“.$prix.” '; } }
你可以看到我在这里所说的:

只要选择互联网


谢谢大家!

您缺少每个框的结束标记。现在,您有了一个包含大量重复字段的大表单:

<form method="POST" action="Fournisseurs/Videotron.php" id="'.$id.'">
box 1:
<input type="hidden" name="id" value="'.$id.'"></input>
.... box 2:
<input type="hidden" name="id" value="'.$id.'"></input>
...

框注1:
.... 框注2:
...
各种
输入
名称
属性是发送的属性,并且在每个
表单
中应该是唯一的


只要在
循环中添加
标记,它就会工作。

您缺少每个框的关闭
标记。现在,您有了一个包含大量重复字段的大表单:

<form method="POST" action="Fournisseurs/Videotron.php" id="'.$id.'">
box 1:
<input type="hidden" name="id" value="'.$id.'"></input>
.... box 2:
<input type="hidden" name="id" value="'.$id.'"></input>
...

框注1:
.... 框注2:
...
各种
输入
名称
属性是发送的属性,并且在每个
表单
中应该是唯一的


只要在
循环中添加
标记,它就会工作。

我在循环中没有看到结束标记。表单id错误。显示控制台错误-“未捕获的TypeError:无法读取null的属性'submit'。您的表单id是18,但在锚标记中,您提交的是document.getElementById(22).submit()这样的内容。ID22是隐藏的输入类型。@ManikandanS表单id属性绝对正确。查看源代码时,它们都与相应的getElementById()匹配。控制台错误的原因是没有关闭表单标记,因此getElementById()找不到关闭不正确的元素。@AdamKonieska是的,我接受了你的答案。这是我的错。我没有注意到很多Hanks,但现在在网站上查看它的外观:/我没有在您的循环中看到结束标记。表单id是错误的。显示控制台错误-“未捕获的TypeError:无法读取null的属性'submit'。您的表单id是18,但在锚标记中,您提交的是document.getElementById(22).submit()这样的内容。ID22是隐藏的输入类型。@ManikandanS表单id属性绝对正确。查看源代码时,它们都与相应的getElementById()匹配。控制台错误的原因是没有关闭表单标记,因此getElementById()找不到关闭不正确的元素。@AdamKonieska是的,我接受了你的答案。这是我的错。我没有注意到很多Hanks,但现在看看网站上的样子:/噢,谢谢,伙计们,现在问题是网站上的looking:/噢,谢谢,伙计们,现在问题是网站上的looking:/