繁体   English   中英

Joomla模块中的“提交”按钮不起作用

[英]Submit button in Joomla module not work

请告知如何解决Joomla! 问题。 在Joomla外的PHP文件中! 提交按钮完美工作,并启动POST方法将数据发送到数据库。 当我创建了Joomla之后! 模块内部具有完全相同的代码,并用{source} {/ source}标签覆盖,填写表格后,我在控制台中收到以下错误消息:

 < div class = "g-block size-100" > <div id = "custom-8642-particle" class = "g-content g-particle" > < h2 class = "g-title" > We are sorry! < /h2> < p > Gantry 5 provides a custom error page for you to configure with either positions, particles or a combination of both, as well as styling. < /p> < /div> 
PHP文件代码在Joomla之外起作用! 并提供此错误在这里:

 <?php require_once ("pg_conn.php"); if (isset ( $_POST ['submit'] )) { $elem = $_POST; foreach ( $elem as $key => $value ){ } unset ( $elem ['submit'] ); $res = pg_insert ( $dbconn, 'test.tb_54646', $elem ); if ($res) { echo "Record completed"; } else { echo "NOT completed"; } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script> function sendForm(form) { form.submit(); } </script> </head> <body> <table> <tbody> <form method="post" action="area.php"> <tr> <td><label for="street">Street:</label></td> <td><input type="text" name="street" onchange="sendForm(this.form)"></td> </tr> <tr> <td><label for="building_no">Building No:</label></td> <td><input type="text" name="bld_no"></td> </tr> <tr> <td><label for="ID Sector">ID Sector:</label></td> <td><input type="text" name="id_sector"></td> </tr> ------------------ <tr> <td><input type="reset" name="reset" value="Clear It"></td> <td><input type="submit" onClick="return nodata(this.form)" name="submit" value="Submit"> </td> </tr> </form> </tbody> </table> </body> </html> 

`

这是我的错误,我没有从插入的Joomla模块代码中删除action="area.php" ,现在更改后一切正常,而不是:

 < form method = "post" action = "area.php" > 
工作代码:

 <form method ="post"> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM