[轉]php使用者登入代碼_PHP教程

來源:互聯網
上載者:User
一款講得非常詳細的登入代碼,對php入門者有很大的協助,有需要的朋友可以免費查看。

index.php教程

代碼如下 複製代碼




系統登入



系統後台登陸




資料庫教程串連 connect.php

代碼如下 複製代碼

$connect=mysql教程_connect("localhost","root","")or die("伺服器串連失敗");
mysql_select_db("test",$connect)or die("沒有建立相應的資料庫");
$sql="select * from admin";
?>

圖片驗證碼 piccheck.php

代碼如下 複製代碼
/*
* Created on 2011-8-10
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclips教程e - PHP - Code Templates
*/
session_start();
$code=rand(0,9).dechex(rand(10,15)).rand(0,9).dechex(rand(10,15));
$_SESSION[pic]=$code;
$image=imagecreatetruecolor(50,18);
$color=imagecolorallocate($image,0,0,0);//第一次使用調色盤,會設為背景顏色
$colortext=imagecolorallocate($image,rand(100,255),rand(100,255),rand(100,255));
imagestring($image,10,rand(1,15),rand(1,5),$code,$colortext);
imagegif($image);
?>

css.css檔案

代碼如下 複製代碼

@charset "utf-8";
/* CSS Document */

body {
background-color: #9CF;
text-align: left;
}
#denglu {
width: 400px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
background-image: url(images/login.gif);
background-repeat: no-repeat;
height: 320px;
text-indent: 6px;
}
#box #denglu form {
position: relative;
top: 50px;
left: 10px;
width: 92%;
}
.must {
color: #F00;
font-size: 12px;
}
#box #denglu #pic {
background-image: url(images/dot1.gif);
background-repeat: no-repeat;
height: 20px;
width: 100px;
font-size: 12px;
color: #F00;
text-align: left;
line-height: 18px;
left: 10px;
top: 30px;
position: relative;
}

http://www.bkjia.com/PHPjc/631327.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631327.htmlTechArticle一款講得非常詳細的登入代碼,對php入門者有很大的協助,有需要的朋友可以免費查看。 。 index.php教程 代碼如下 複製代碼 !DOCTYPE...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.