复选框不会在POST中使用PHP发送 [英] Checkbox not being sent in POST using PHP

查看:98
本文介绍了复选框不会在POST中使用PHP发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复选框,它没有使用POST发送到回调页面。我读过它需要一个价值,我提供了,但不知道还有什么可能是错的。这是我目前使用的复选框代码。

  {foreach from = $ all_splash_carriers item = item} 
< tr>
< td class =evp> {$ item.carrier}:< / td>
< td>< input name ={$ item.splash_carriers_id} .scarcarrier。{$ item.carrier_id}value ={$ item.url}/>< input type =checkbox name ={$ item.carrier_id} .checkboxvalue =1{if $ item.activated =='1'} checked {/ if} />已激活< / td>

< tr>
{/ foreach}


解决方案

如果未检查,则不发送。

另外,PHP默默地将名称中的任何点转换为下划线,否则register_globals模式将呈现无法访问的全局变量。 p>

I have a checkbox and it is not being sent to the call back page using POST. I've read that it needs a value, and I supplied that, but am not sure what else could be wrong. Here's the checkbox code I am currently using. Smarty is being used here.

{foreach from=$all_splash_carriers item=item}
            <tr>
                    <td class="evp">{$item.carrier}:</td>
                    <td><input name="{$item.splash_carriers_id}.splashcarrier.{$item.carrier_id}" value="{$item.url}"/><input type="checkbox"  name="{$item.carrier_id}.checkbox" value="1" {if $item.activated == '1'}checked{/if}/>Activated</td>

            <tr>
{/foreach}

解决方案

The checkbox is not sent if it is not checked.

Also, PHP silently converts any dots in names to underscores, because otherwise the "register_globals" mode would render inaccessible global variables.

这篇关于复选框不会在POST中使用PHP发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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