TP 복습4
7733 단어 T
<script>
window.onload=function(){
if(<{$data.sex}>==0){
document.getElementsByName('sex')[1].checked='checked';
}else{
document.getElementsByName('sex')[0].checked='checked';
}
}
</script>
<?php
class UserAction extends Action{
public function index(){
$m=M('User');
$arr=$m->select();
//var_dump($arr);
$this->assign('data',$arr);
$this->display();
}
public function del(){
$m=M('User');
$id=$_GET['id'];
$count=$m->delete($id);
if($count>0){
$this->success(' ');
}else{
$this->error(' ');
}
}
/*
*
* */
public function modify(){
$id=$_GET['id'];
$m=M('User');
$arr=$m->find($id);
$this->assign('data',$arr);
$this->display();
}
public function update(){
$m=M('User');
$data['id']=$_POST['id'];
$data['username']=$_POST['username'];
$data['sex']=$_POST['sex'];
$count=$m->save($data);
if($count>0){
$this->success(' ','index');
}else{
$this->error(' ');
}
}
/*
*
* */
public function add(){
$this->display();
}
public function create(){
$m=M('User');
$m->username=$_POST['username'];
$m->sex=$_POST['sex'];
$idNum=$m->add();
if($idNum>0){
$this->success(' ','index');
}else{
$this->error(' ');
}
}
}
?>
-------------------------------------------------------------------
<script>
function jump(){
window.location="/thinkphp/index.php/User/add";
}
</script>
__URL__대표
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
자바 범 형 방법 정의 및 범 형 유형 추정일반적인 추론 한 배열 에 들 어가 서 두 가 지 를 교환 합 니 다. 범 형 을 정의 할 때 형식 제한: 위의 코드 는 T 가 Object 의 하위 클래스 라면 쓸데없는 말 이 라 고 요구 합 니 다. Object...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.