PHP项目开发

时间:2022-05-11 12:02:54

PHP项目开发

===================================

member:(用户表)

userid  username  password  name  mobile  emai  address  qq  add_time  edit_time    status

category:(栏目表)

catid  moduleid  catname  linkurl  parentid

===================================

$totime = $todate ? strtotime($todate.' 23:59:59') : 0;

-----------------------------------------------------

<input type="text" name="info['username']"><br><br>

$data = input('post.')['info'];

$_REQUEST['username'];

==========================================

function myfun()
  {
//    alert("this window.onload");
document.getElementById("company").value = '';
  }
  /*用window.onload调用myfun()*/
  window.onload = myfun;//不要括号

---------

三元表达式

val = $('#captcha').val();  //获取div内容

switch($action) {
  case 'detail':

    echo ‘111’;
    break;
  case 'agreement':
    break;
  case 'success':

    break;
  default:
    break;
}

---------------------------------------------

<form method="post" enctype="multipart/form-data" onsubmit="return check()">

<input type="submit" class="submit" value="立即注00册" onclick="sub()">
</form>

-------

function check(){
$username = $('#username').val();
if ($username=='') {
webToast("恭喜您,修改成功恭喜您,修改成功恭喜您修改成功恭喜您","middle",2000);
return false;
}

}

=======================================

function Dregister() {
var val,len;
val = $('#username').val();
len = val.length;
if(len < 5 || len > 16) {
Dtoast('会员名长度限制为5-16');
return false;
}
if(val.indexOf('__') != -1 || val.indexOf('--') != -1) {
Dtoast('会员名中划线和下划线不能连续出现');
return false;
}
if(!val.match(/^[a-z0-9]{1}[a-z0-9_\-]{0,}[a-z0-9]{1}$/)) {
Dtoast('会员名限制为小写字母、数字组合');
return false;
}
val = $('#password').val();
len = val.length;
if(len < {$MOD[minpassword]} || len > {$MOD[maxpassword]}) {
Dtoast('密码长度限制为{$MOD[minpassword]}-{$MOD[maxpassword]}');
return false;
}
val = $('#email').val();
len = val.length;
if(len < 7 || !val.match(/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/)) {
Dtoast('请填写正确的电子邮箱');
return false;
}
{if $itemid > 5}
val = $('#company').val();
len = val.length;
if(len < 4) {
Dtoast('请填写公司全称');
return false;
}
{/if}
val = $('#truename').val();
len = val.length;
if(len < 2) {
Dtoast('请填写真实姓名');
return false;
}
{if $verify_type=='mobile'}
val = $('#mobile').val();
if(!val.match(/^1[3|4|5|7|8]{1}[0-9]{9}$/)) {
Dtoast('请填写正确的手机号码');
return false;
}
{/if}
{if $MOD[captcha_register]}
val = $('#captcha').val();
if(!is_captcha(val)) {
Dtoast('请填写验证码');
return false;
}
{/if}
$.post('register.php', $('#dform').serialize(), function(data) {
if(data == 'ok') {
Go('register.php?action=success');
} else if(data == 'group') {
Dtoast('请选择会员组');
setTimeout(function() {
Go('register.php?reload={$DT_TIME}');
}, 1000);
} else if(data == 'passport') {
Dtoast('会员名已经被注册');
$('#username').val('');
} else if(data == 'captcha') {
Dtoast('验证码错误');
reloadcaptcha();
} else {
data = data.replace('昵称', '会员');
//alert(data);
Dtoast(data);
}
});
return;
}

===========================