#1 xiaorong321
function write(){ // 这里是留言是不是用spArgs来接收html表单里面的用户名的值。
$conditions = array( 'user_id' => 'xiaorong321' );
$user = spClass("test");
$result = $test->findCount($conditions); // 使用了findCount
echo $result;
if($result==0)
{
$newrow = array( // 这里制作新增记录的值
'user_id' => $this->spArgs('user_id'),
'pwd' => $this->spArgs('pwd'), // 从spArgs获取到表单提交上来的title
'question' => $this->spArgs('question'),
'answer' => $this->spArgs('answer'),
'email' => $this->spArgs('email'),
);
$user->create($newrow);
echo "注册成功,返回";
}
else
{
echo "用户名已经存在,请换个号码重新注册!";
}
}
上面只是用xiaorong321来测试,请问哪里出错了,或者怎么写代码?
谢谢
2011-04-02 09:39:55