1.数据库连接
$conn=mysql_connect("localhost","root","");
mysql_select_db("baoming");
mysql_query("set names gbk");
-------------------------------------------------------------------
2。smarty,fck配置。
-------------------smarty配置:-------------------------------
------------------fck配置--------------------------------------------
----------------------------------------------------------------------
3。查,插,改,删,
--------------查询(一维数组)------------------------------------
----------------------------------------------------------------------------------
6,缩略图
------------------------------------------------------------------------------------------------------------------
$file_name为图片的路径
$img=null;
$ext=strtolower(end(explode(".",$file_name)));
if($ext == 'jpg' || $ext == 'jpeg'){//判断图片的类型,创建相应的图片
$img = @imagecreatefromjpeg($updir_file);
}elseif($ext == 'png'){
$img = @imagecreatefrompng($updir_file);
}elseif($ext=='gif'){
$img=imagecreatefromgif($updir_file);
}
list($RealWidth, $RealHeight) = getimagesize($img); //获取图片的宽高。
$shuoluetu=imagecreatetruecolor(100,100);//创建真彩图
imagecopyresized($shuoluetu,$img,0,0,0,0,100,100,$RealWidth,$RealHeight);//创建100*100的缩略图
-----------------------------------------------创建缩略图------------------------------------------------------------------------------------------------------------
7,表单JS验证
-------------------JS验证(此处定义一个函数放在JS文件中)---------------------------------------------------------
function check(){
if(document.form1.userid.value==""){
alert("请输入用户名!");
document.form1.userid.focus();
return false;
}
if(document.form1.userid.value.length10){
alert("用户名必须在5到10位之间!");
document.form1.userid.focus();
return false;
}
var m1=/[\u4e00-\u9fa5]/g;
if(!m1.test(document.form1.name.value)){
alert(姓名必须是中文!);
form1.name.value.focus();
return false;
}
}
在HTML中调用
--------------------------------------JS验证,一个对话框创建一个函数,-----------------------------------------------------------------------------
my_check.js---------------
function register_userid_check(){
var text1="document.form1.userid.value";
if(document.form1.userid.value==""){
document.getElementById('userid_c').innerHTML="用户名不能为空";
return false;
}
/*}else{
document.getElementById('userid_c').innerHTML="";
}*/
else if(document.form1.userid.value.length>10 || document.form1.userid.value.length=document.form1.userid.value.length)
{
document.getElementById('userid_c').innerHTML="√";
return true;
}
}
function register_password_check(){
if(document.form1.password.value==""){
document.getElementById('password_c').innerHTML="密码不能为空";
return false;
}else if(document.form1.password.value.length
----------------------------------------------------页面跳转-----------------------------------------------------------------------------
3< /a>秒后自动返回…
function countDown(secs){
tiao.innerText=secs;
if(--secs>0){
setTimeout("countDown("+secs+")",1000);
}else{
location.href="xx.html"//top.location.href=""//跳转到上级页面。
}
}
countDown(3);
-------------------------页面跳转---------------------------------------------------------------------------------
header("location:xx.html");//头信息跳转
javascript:history.back(1);//后退一步跳转
//meta跳转,content=2指暂停2秒再跳转
top.location='yy.html' //返回上一级页面再跳转
setTimeout(top.location='xx.php',50000);//用于在指定的毫秒数后调用函数或计算表达式。
location.href='register.php';//跳转
history.go(-1);//返回跳转
//body中加载跳转,top指先回到上一级页面再跳转。
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com