如何确定单选框是否要被选中

WBOY
Release: 2016-06-23 14:00:36
Original
2165 people have browsed it

需要从后台数据库中读取某值,通过该值来判断前台界面的单选框是否被选中,应该怎么写?网上找了些不能用啊。

求一段范例代码

>

这样是错的,求正解。


回复讨论(解决方案)

checked="checked"

>
Copy after login

写法是没有错的
你把你的$open输出来看看 是不是1

写法是没有错的
你把你的$open输出来看看 是不是1


楼上说的还是有可能的, 先确认$open 是否为1 . 按理说你的写法是没问题的.


不知道你的html 和 php 是否是分离的,如果是分离的, 你可以在 php程序里判断 声明变量接收 , 在页面里调用变量. 如果不是分离的那就继续用你的方法就可以了.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!