帮我翻译一段代码

jiang_jiajia10 2010-03-23 05:32:42

//生日:年
$birthyeayhtml = '';
$nowy = sgmdate('Y');
for ($i=1; $i<80; $i++) {
$they = $nowy - $i;
$selectstr = $they == $space['birthyear']?' selected':'';
$birthyeayhtml .= "<option value=\"$they\"$selectstr>$they</option>";
}
//生日:月
$birthmonthhtml = '';
for ($i=1; $i<13; $i++) {
$selectstr = $i == $space['birthmonth']?' selected':'';
$birthmonthhtml .= "<option value=\"$i\"$selectstr>$i</option>";
}
//生日:日
$birthdayhtml = '';
for ($i=1; $i<32; $i++) {
$selectstr = $i == $space['birthday']?' selected':'';
$birthdayhtml .= "<option value=\"$i\"$selectstr>$i</option>";
}

转成coldfusion
...全文
189 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xupeihuagudulei 2010-03-25
  • 打赏
  • 举报
回复
佳佳好久没去.net啦
Dogfish 2010-03-24
  • 打赏
  • 举报
回复
没有做过wap的网站,sorry。
jiang_jiajia10 2010-03-24
  • 打赏
  • 举报
回复
谢谢你了,还有就是有没有coldfusion做的两级联动菜单呢?因为我做的是wap系统不支持js所以没法使用,帮忙给我举个例子,不用JS做的两级联动菜单
Dogfish 2010-03-23
  • 打赏
  • 举报
回复
<!--- 这里的space是一个struct,楼主自己修改一下就可以动的了 --->
<!--- 生日:年 --->
<cfset birthyeayhtml = "">
<cfset nowy = year(now())>
<cfloop from="1" to="80" index="i">
<cfset they = nowy-i>
<cfset selectstr = IIF(they eq space["birthyear"], de("selected"), de(""))>
<cfset birthyeayhtml = birthyeayhtml & '<option value="#they#" #selectstr#>#they#</option>'>
</cfloop>

<!--- 生日:月 --->
<cfset birthmonthhtml = ''>
<cfloop from="1" to="12" index="i">
<cfset selectstr = IIF(i eq space["birthmonth"], de("selected"), de(""))>
<cfset birthmonthhtml = birthmonthhtml & '<option value="#i#" #selectstr#>#i#</option>'>
</cfloop>

<!--- 生日:日 --->
<cfset birthdayhtml = ''>
<cfloop from="1" to="31" index="i">
<cfset selectstr = IIF(i eq space["birthday"], de("selected"), de(""))>
<cfset birthdayhtml = birthdayhtml & '<option value="#i#" #selectstr#>#i#</option>"'>
</cfloop>
jiang_jiajia10 2010-03-23
  • 打赏
  • 举报
回复
就是用coldfusion生成一个日期选择框

879

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 ColdFusion
社区管理员
  • ColdFusion社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧