Home > Backend Development > PHP Tutorial > CodeIgniter PHP 单选框选中与不选中解决思路

CodeIgniter PHP 单选框选中与不选中解决思路

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:47:52
Original
796 people have browsed it

CodeIgniter PHP 单选框选中与不选中
            " />启用
            " />停用

控制层那边传到页面是status 里面 1是启用 2是停用,如果控制层传过来是1 那么就选中启用相反,控制层传过来是2 那么就是停用。


 我上面写的没有效果,求大虾指点
------解决方案--------------------

<br /><input type="radio" name="status" <?php if($status==1){ ?> checked="checked" <?php } ?> id="status" value="<?php if(isset($status)){ echo($status);} ?>" />启用<br /><input type="radio" name="status" id="status"  <?php if($status==2){?> checked="checked" <?php } ?> value="<?php if(isset($status)){ echo($status);} ?>" />停用<br />
Copy after login

------解决方案--------------------
在模板里写php可以这样写
if (true) /**这里写代码*/endif;
Copy after login


要不看到都是大括号,很不好看。。。

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template