设置效验php代码
点击复制代码 PHP
$act = GetVars("act", "GET");
if ($act === "save") {
CheckIsRefererValid();
foreach ($_POST['ytecn'] as $key => $value) {
$zbp->Config("ytecn_wzmh")->$key = $value;
}
$zbp->SaveConfig("ytecn_wzmh");
$zbp->SetHint('good');
Redirect('./main.php');
}
html代码
点击复制代码 PHP
<form method="post" action="main.php?act=save">
<input type="hidden" name="csrfToken" value="<?php echo $zbp->GetCSRFToken(); ?>">
<table border="1" class="tableFull tableBorder">
<tr>
<th class="td30">
<p align='left'><b>标题</b><br><span class='note'></span></p>
</th>
<th>说明</th>
</tr>
<tr>
<td class="td30">
<p align='left'><b>开关按钮</b></p>
</td>
<td><input type="text" id="seoon" name="ytecn[seoon]" class="checkbox" value="<?php echo (int)($zbp->Config('ytecn_ai_xzjt')->seoon); ?>"></td>
</tr>
<tr>
<td class="td30">
<p align='left'><b>单选按钮</b></p>
</td>
<td>
<?php
$array=array();
$array['0']="最老的文章";
$array['1']="最新的文章";
echo zbpform::radio('ytecn[onorder]', $array, $zbp->Config('ytecn_ai_xzjt')->onorder); ?>
</td>
</tr>
<tr>
<td class="td30">
<p align='left'><b>首页关键词</b></p>
</td>
<td><input type="text" name="ytecn[seokey]" value="<?php echo htmlspecialchars($zbp->Config('ytecn_ai_xzjt')->seokey); ?>" /></td>
</tr>
<tr>
<td class="td30">
<p align='left'><b>首页描述</b></p>
</td>
<td><textarea type="text" name="ytecn[seodes]"><?php echo htmlspecialchars($zbp->Config('ytecn_ai_xzjt')->seodes); ?></textarea>
</td>
</td>
</tr>
<tr>
<td class="td30"></td>
<td>
<input name="" type="Submit" class="button" value="保存" />
</td>
</tr>
</table>
</form>