當前位置:首頁 » 注冊證書 » 登陸注冊

登陸注冊

發布時間: 2020-11-22 14:55:35

『壹』 編一個注冊登陸的程序 C語言的

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

bool search(char id[], char pass[]) {
FILE *fp;
char tid[10], tpass[10];
fp = fopen("c:\\data", "r");
while (!feof(fp)) {
fscanf(fp, "%s%s", tid, tpass);
if (strcmp(tid, id)==0 && strcmp(tpass, pass)==0) {
fclose(fp);
return true;
}
}
fclose(fp);
return false;
}

bool login() {
char id[10], pass[10];
printf("Login\nPress the id: ");
scanf("%s", id);
printf("Press the password: ");
// 可以自行將password處理成*號, 如果不會可以發信給我
scanf("%s", pass);
printf("-----------------------");
if (search(id, pass))
return true;
else
return false;
}

void _add(char id[], char pass[]) {
FILE *fp;
fp=fopen("c:\\data", "a");
// 在寫入文件時可以按一定的排序方式插入,可減少以後Login時的search時間
fprintf(fp, "%s %s\n", id, pass);
fclose(fp);
}

void regis() {
char id[10], pass[10], tpass[10];
printf("Register\nPress the id: ");
scanf("%s", id);
while (true) {
printf("Press the password: ");
scanf("%s", pass);
printf("Press the password again: ");
scanf("%s", tpass);
if (strcmp(pass, tpass) != 0)
printf("The passwords you pressed are not the same!\n");
else
break;
}
_add(id, pass);
printf("-----------------------Register successfully!\n");
}

void init() {
FILE *fp;
if ((fp=fopen("c:\\data", "r")) == NULL) { // 注意,一定要有個名叫data(沒有擴展名)的合法文件在C盤根目錄
printf("---------File is not exist\n");
system("pause");
exit(0);
}
else
fclose(fp);
}

int main(void){
int command;
init(); // 檢查data文件在不在
while (true) {
printf("-----------------------(Login: 1 Register: 2 Exit: 3)\n");
scanf("%d", &command);
printf("-----------------------\n");
// 這里可以編寫command的檢測語句
if (command == 3)
break;
else if (command == 1) {
if (!login())
printf("ID is not exist or password is wrong!\n");
else
printf("Login successfully!\n");
}
else
regis();
}
return 0;
}
搞定了。。。我是用成功了的。。。如果有問題就發信給我。。。。

『貳』 網站的用戶注冊與登陸是怎樣實現的

注冊:

  1. Input流:輸入反饋的注冊信息

  2. Javascript的Validate檢測用戶信息是否正確 》 true:繼續?false:Output流警告用戶輸入錯誤信息

  3. PHP的錄入反饋資料庫》true:繼續?false:Output流警告用戶輸入錯誤信息

  4. Output流:反饋用戶

登錄

  1. Input流:輸入反饋的登錄信息

  2. Javascript的Validate檢測用戶信息是否正確 》 true:繼續?false:Output流警告用戶輸入錯誤信息

  3. PHP的檢測反饋資料庫》true:繼續?false:Output流警告用戶輸入錯誤信息

  4. Output流:反饋用戶

(2)登陸注冊擴展閱讀

登陸 與 登錄

登陸(Land) :這個詞是網上最泛濫的錯別用詞,幾乎一半以上的網站(特別是草根網站)都把這個詞放在登錄界面上,其實這是錯的。這個詞里的「陸」字,就是陸地的意思,其基本含義只是登上陸地而已,引申出來才會有「登陸市場」這些意思,但絕不應該說「登陸網站」。

登錄(login):有「登記記錄」的意思,輸入帳號密碼登錄網站正是為了登記記錄用戶資料。

登入(login):港台對Login的譯法,同登錄,可理解為「登記進入」的意思。

資料來源:網路:用戶登錄

『叄』 C語言編程:實現用戶的注冊和登錄

模擬用戶注冊和登陸可以用文件來保存用戶名和密碼。注冊就是向文件里寫,用if判斷兩次密碼是否一致。連續三次,可以有一個變數,每次輸入加一,變數大於三就提示登陸不成功。用戶名不對,那你就把你輸入的用戶名和文件里的用戶名是否一致。

『肆』 注冊,登錄用英語怎麼說

Sign up, sign in

詞彙分析:

sign

英 [saɪn]

美 [saɪn]

n、跡象;徵兆;預兆;招牌;標牌;指示牌;標志;示意的動作(或聲音);手勢

v、簽(名);署(名);簽字;簽署;和…簽約(或應聘);示意;打手勢

第三人稱單數: signs

復數: signs

現在分詞: signing

過去式: signed

過去分詞: signed

派生詞: signer n.

(4)登陸注冊擴展閱讀:

其他翻譯:register,log on

詞彙分析:

register

英 [ˈredʒɪstə(r)]

美 [ˈredʒɪstər]

v、登記;注冊;(正式地或公開地)發表意見,提出主張;顯示(讀數);記錄

n、登記表;注冊簿;登記簿;聲區;音區;(適合特定場合使用的)語體風格,語域

第三人稱單數: registers

復數: registers

現在分詞: registering

過去式: registered

過去分詞: registered

記憶技巧:re 重新 + gister 帶來 → 再次帶來〔新來的學生〕→〔學員〕登記,注冊

『伍』 java語言實現用戶注冊和登錄

//這個是我寫的,裡面有連接資料庫的部分。你可以拿去參考一下
import java.awt.*;
import javax.swing.*;

import java.awt.event.*;
import java.sql.*;

class LoginFrm extends JFrame implements ActionListener// throws Exception
{
JLabel lbl1 = new JLabel("用戶名:");
JLabel lbl2 = new JLabel("密碼:");
JTextField txt = new JTextField(5);
JPasswordField pf = new JPasswordField();
JButton btn1 = new JButton("確定");
JButton btn2 = new JButton("取消");

public LoginFrm() {
this.setTitle("登陸");
JPanel jp = (JPanel) this.getContentPane();
jp.setLayout(new GridLayout(3, 2, 5, 5));
jp.add(lbl1);
jp.add(txt);
jp.add(lbl2);
jp.add(pf);
jp.add(btn1);
jp.add(btn2);
btn1.addActionListener(this);
btn2.addActionListener(this);
}

public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == btn1) {
try {
Class.forName("com.mysql.jdbc.Driver");// mysql資料庫
Connection con = DriverManager.getConnection(
"jdbc:mysql://localhost/Car_zl", "root", "1");// 資料庫名為Car_zl,密碼為1
System.out.println("com : "+ con);
Statement cmd = con.createStatement();
String sql = "select * from user where User_ID='"
+ txt.getText() + "' and User_ps='"
+ pf.getText() + "'" ;
ResultSet rs = cmd
.executeQuery(sql);// 表名為user,user_ID和User_ps是存放用戶名和密碼的欄位名

if (rs.next()) {
JOptionPane.showMessageDialog(null, "登陸成功!");
} else
JOptionPane.showMessageDialog(null, "用戶名或密碼錯誤!");
} catch (Exception ex) {

}

if (ae.getSource() == btn2) {
System.out.println("1111111111111");
//txt.setText("");
//pf.setText("");
System.exit(0);
}
}
}

public static void main(String arg[]) {
JFrame.(true);
LoginFrm frm = new LoginFrm();
frm.setSize(400, 200);
frm.setVisible(true);
}
}

『陸』 求一個HTML登陸注冊代碼!

用戶名
密碼
表單的內容提交到後台程序,這個提交到login.asp了

『柒』 用PHP做登陸注冊頁面

||登錄頁:login.php
<?php
include("conn.php");
$username=$_POST['name'];
$password=$_POST['password'];
$yanzheng=$_POST['yanzheng'];

if(isset($_POST['submit']))
{
$sql=("select username,password from member where username='$username' and password='$password'") or die("sql語句執行失敗");
//print_r($sql);
$ar=mysql_query($sql);
if($ar)
{
if($row=mysql_fetch_array($ar))
{
session_start();
if($_POST["yanzheng"])
{
if($yanzheng!=$_session[pic]||$yanzheng=="")
{
echo "驗證碼輸入有誤";
exit;
}
if($yanzheng==$_session[pic])
{
header("location:index.php");
}
}
}
else
{
echo "用戶名或密碼錯誤";
}
}
}

?>

<form action="login.php" method="post">
<table border=1 align=center width=500 height=300 bgColor=#DFFFDF bordercolor=#fffbec>
<tr>
<td colspan=2 align=center>用戶登錄</td>
</tr>
<tr>
<td>用戶姓名:</td>
<td><input type="text" name="name" id="name"/></td>
</tr>
<tr>
<td>用戶密碼:</td>
<td><input type="password" name="password" id="password"/></td>
</tr>
<tr>
<td>驗證碼:</td>
<td><input type="text" name="yanzheng" id="yanzheng"/>
<img src="yanzheng1.php" width="50" height="30"></img>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<input type="submit" name="submit" value="登錄"/>
<input type="reset" name="reset" value="重置"/>
<a href="register.php">注冊</a>
</td>
</tr>
</table>
</form>

注冊頁:register.php

<?php
include("conn.php");
if(isset($_POST['submit'])&&$_POST['submit']) {
if($_POST['username']=='')
{
echo "用戶名不能為空";
exit();
}
if($_POST['password']=='')
{
echo "密碼不能為空";
exit();
}
if($_POST['realpass']!=$_POST['password'])
{
echo "兩次密碼輸入不一致";
exit();
}

$sql="insert into member(username,real_name,password,email,headimg) values('$_POST[username]','$_POST[username]','$_POST[password]','$_POST[email]','')";
$ar=mysql_query($sql);
if($ar)
{
header("location:index.php");
}
else
{
echo mysql_error();
}
}
?>
<body>
<form action="register.php" method="post">
<table border=1 align=center width=500>
<tr>
<td height=40 bgColor=#DFFFDF colspan=2>會員注冊 [<a href="login.php">返回登錄頁</a>]</td>
</tr>
<tr>
<td height=40 bgColor=#fffbec >會員ID</td>
<td><input type="text" name="username" id="username"/></td>
</tr>
<tr>
<td height=40 bgColor=#fffbec>密碼</td>
<td><input type="password" name="password" id="password"/></td>
</tr>
<tr>
<td height=40 bgColor=#fffbec>確認密碼</td>
<td>
<input type="password" name="realpass" id="realpass"/>
</td>
</tr>
<tr>
<td height=40 bgColor=#fffbec>EMAIL</td>
<td><input type="text" name="email" id="email"/>

</tr>
<tr>
<td height=40 bgColor=#fffbec></td>
<td><input type="submit" name="submit" value="注冊"/><input type="reset" value="重置"></td>
</tr>
</table>
</form>
</body>

主頁顯示:index.php
<?php
include("conn.php");
function cutstr($str,$cutleng)
{
$str = $str; //要截取的字元串
$cutleng = $cutleng; //要截取的長度
$strleng = strlen($str); //字元串長度
if($cutleng>$strleng)return $str;//字元串長度小於規定字數時,返回字元串本身
$notchinanum = 0; //初始不是漢字的字元數
for($i=0;$i<$cutleng;$i++)
{
if(ord(substr($str,$i,1))<=128)
{
$notchinanum++;
}
}
if(($cutleng%2==1)&&($notchinanum%2==0)) //如果要截取奇數個字元,所要截取長度范圍內的字元必須含奇數個非漢字,否則截取的長度加一
{
$cutleng++;
}
if(($cutleng%2==0)&&($notchinanum%2==1)) //如果要截取偶數個字元,所要截取長度范圍內的字元必須含偶數個非漢字,否則截取的長度加一
{
$cutleng++;
}
return substr($str,0,$cutleng);
}
?>
<html>
<head>
<script type="text/javascript">
function All(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked; //得到那個總控的復選框的選中狀態
}
function Item(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getElementsByName(e.name);
for (var i=0; i<aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
}
</script>
</head>
<?php
include("conn.php");
if(isset($_POST['del']))
{
$mm = $_POST["selected"];
$id =implode(",",$mm);
$sql = "delete from forums where id in(".$id.")";
//echo $sql;
$result=mysql_query($sql);
echo $result?"刪除成功":"刪除失敗";
}
?>
<table style="BORDER-BOTTOM-WIDTH: 1px; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=600 align=center border=1 bordercolor=#ddddff>
<tr align=middle>
<td height=40 bgColor=#DFFFDF colspan=3>論壇列表</td>
</tr>
<tr>
<td colspan=3><a href="login.php" style="float:right">[退出系統]</a><a href="add_forum.php" style="float:right">[添加論壇]</a></td>
<td></td>
</tr>
<tr align=middle>
<td height=40 bgColor=#DFFFDF width=80>狀態</td>
<td height=40 bgColor=#DFFFDF>論壇</td>
<td height=40 bgColor=#DFFFDF>最後更新</td>
</tr>
<?php
$sql="select * from forums";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0)
{
while($row=mysql_fetch_array($result)){
?>
<tr align=middle>
<td bgColor=#fffbec><input type="checkbox" name="selected" value="1"/></td>
<td height=50 bgColor=#fffbec width=300>
<?php
echo "<div><a href=\"forums.php?F=".$row['ID']."\">".$row['forum_name']."</a></div>";
echo cutstr($row['forum_description'],24);//最多顯示24個位元組,12個字,多餘部分用省略號代替
echo "……";
?>
</td>
<td height=50 bgColor=#fffbec><div><?php echo $row['last_post_time']."by".$row['last_post_author']?></div></td>

</tr>
<?php
}
}
else
{
echo "<tr bgColor=#fffbec><td colspan=3>對不起,論壇尚在創建中……</td></tr>";
}
?>
<tr>
<td colspan=3> <input type="checkbox" name="selected" value="1" onclick="All(this,'selected')"/>全選/不全選</td>
</tr>
<tr>
<td><input type="button" name="del" id="del" value="刪除選中項"/>
<?php

?>
</td>
</tr>
</table>
</html>

資料庫你就自己建,望採納~

『捌』 注冊/登陸頁面HTML代碼該怎麼寫

以下為個人原創教學例子,任何人引用需註明出自網路知道用戶am7972,樓主可供參考
該例子涵蓋了文本框、密碼框、下拉菜單、單選框、復選框及文本區的使用
同時在數據的使用方面涵蓋了文本型、數值型、日期型、布爾型的使用
也涵蓋了在會員信息入資料庫前,進行嚴格的數據檢查
不足處,JS驗證還不是太完善,不過有服務端認證足夠了
<title>會員注冊</title>
<script type="text/javascript">
<!--function CheckForm()
{
if(document.userinfo.username.value == "")
{ alert("請輸入姓名,姓名不能為空!");
document.userinfo.username.focus();
return false;
}
if(document.userinfo.username.value.length > 10)
{
alert("輸入的姓名長度最多為10個字元!");
document.userinfo.username.focus();
return false;
}
}
//--></script>
</head>
<body>
<table border="1" width="53%" bordercolorlight="#000000" cellspacing="0" id="table1" height="358" bordercolor="#000000" bordercolordark="#FFFFFF" cellpadding="0">
<form method="POST" action="bb.asp" name="userinfo" onsubmit="return CheckForm();">
<tr><td colspan="2" height="37"> <p align="center">會員注員</td> </tr>
<tr> <td width="37%" align="right">姓名:</td> <td width="61%"> <input type="text" name="username" value="libin" size="13"> </td> </tr>
<tr> <td width="37%" align="right">密碼:</td> <td width="61%"> <input type="password" name="userPassword" size="20" value="123"></td> </tr>
<tr> <td width="37%" align="right">性別:</td> <td width="61%"><input type="radio" value="True" checked name="Sex">男 <input type="radio" name="Sex" value="False">女</td> </tr>
<tr> <td width="37%" align="right">生日:</td> <td width="61%"> <input type="text" name="userSR" size="11" value="1985-03-12"></td> </tr>
<tr> <td width="37%" align="right">年齡:</td> <td width="61%"><input type="text" name="userNL" size="9" value="13"></td> </tr>
<tr> <td width="37%" align="right">愛好:</td> <td width="61%"> <input type="checkbox" name="ah" value="sw">上網 <input type="checkbox" name="ah" value="ds" checked>讀書 <input type="checkbox" name="ah" value="ty">體育</td> </tr>
<tr> <td width="37%" align="right">上網方式:</td> <td width="61%">
<select size="1" name="swfs"> <option selected value="bhsw">撥號上網</option> <option value="wxsw">無線上網</option> <option value="gxsw">光纖上網</option> </select>
</td> </tr>
<tr> <td width="37%" align="right">個人簡介:</td> <td width="61%"><textarea rows="9" name="userGrjs" cols="34"></textarea></td> </tr> <tr> <td colspan="2" height="38"> <p align="center"><input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"></td>
</tr>
</form>
</table>
====bb.asp的會員注冊非法數據監測====
<%
username = Request("username")
userPassword = Request("userPassword")
Sex = Request("Sex")
userSR = Request("userSR")
userNL = Request("userNL")
ah = Request("ah")
swfs = Request("swfs")
userGrjs = Request("userGrjs")
'判斷數據合法性,絕對不能讓非法數據進入系統
'判斷姓名username合不合法,是否包含非法數據
username = Trim(username) '例如:" 張 三 "經過處理之後變成"張 三"
If username ="" Then
Response.write "姓名不能為空"
Response.End
End If
If Len(username)>10 Then
Response.write "姓名字數不能超過10個字" 'Len("Z")=1 Len("國")=2
Response.End
End If
For i = 1 To Len(username)
q = Mid(username,i,1)
If InStr("!@#$%^&*()_-+|<>?/"",.",q)>0 Then
Response.write "姓名不能包含特殊符號!@#$%^&*()_-+|<>?/"",."
Response.End
End If
Next
'判斷密碼合不合法,是否包含非法數據userPassword = Trim(userPassword)If userPassword ="" Then Response.write "密碼不能為空" Response.EndEnd If
If Len(userPassword)>20 Then
Response.write "密碼字數不能超過20個字"
Response.End
End If
'判斷密碼合不合法,是否包含非法數據
Sex = Trim(Sex)
If Sex = "" Then
Response.write "性別不能為空"
Response.End
End If
If Sex <> "True" And Sex <> "False" Then
Response.write "性別不能為不男不女"
Response.End
End If
'判斷生日合不合法,是否包含非法數據
userSR = Trim(userSR)
If userSR ="" Then
Response.write "生日不能為空"
Response.End
End If
If Len(userSR)<8 Or Len(userSR)>10 Then '例如:2012-6-3 2012-11-23
Response.write "你輸入的生日字數不對,應為2012-6-3或2012-11-23格式"
Response.End
End If
If IsDate(userSR)=False Then
Response.write "你輸入的生日格式不能轉化為日期,請核實"
Response.End
End If
If DateDiff("yyyy",userSR,Date())<1 Or DateDiff("yyyy",userSR,Date())>200 Then
Response.write "根據你輸入的生日你可能小於1歲或已經超過200歲了,請核查重新輸入"
Response.End
End If
'判斷年齡合不合法,是否包含非法數據userNL = Trim(userNL)If userNL ="" Then
Response.write "年齡不能為空"
Response.End
End If
If IsNumeric(userNL)=False Then
Response.write "你輸入的年齡不能轉化為數值,請核查"
Response.End
End If
userNL = CInt(userNL)
If userNL<0 Or userNL>200 Then
Response.write "你輸入的年齡不能小於0歲或者大於200歲,請核查"
Response.End
End If
'判斷愛好合不合法,是否包含非法數據ah = Trim(ah) '選擇多個愛好則系統會用,分開 //測試
ah = Replace(ah," ","")
arrAh = Split(ah,",")
For i = LBound(arrAh) To UBound(arrAh)
If arrAh(i)<>"sw" And arrAh(i)<>"ds" And arrAh(i)<>"ty" Then
Response.write i & "你選擇的愛好有問題,請核查" & arrAh(i)
Response.End
End If
Next
'判斷上網方式合不合法,是否包含非法數據swfs = Trim(swfs)If swfs = "" Then
Response.write "上網方式不能為空"
Response.End
End If
If swfs<>"bhsw" And swfs<>"wxsw" And swfs<>"gxsw" Then
Response.write "你選擇的上網方式有問題,請核查"
Response.End
End If
'判斷個人簡介是否為空,是否超出1000個字
userGrjs = Trim(userGrjs)
If userGrjs = "" Then
Response.write "個人簡介不能為空"
Response.End
End If
If Len(userGrjs) > 1000 Then
Response.write "個人簡介不能超過1000個字"
Response.End
End If
Response.write "數據合法性檢測通過"
%>
====登陸的HTML代碼可相信樓主參照會員注冊代碼應該沒問題了====

『玖』 如何為網頁製作一個有用戶登陸和注冊的功能網頁

這應該不是僅僅高手知道的吧?
原理是這樣的:
如果是明文保存密碼的話就簡單版了,入門也都教這樣的權,我也說這樣的例子。
注冊就是設置(最基本)兩個input,一個用戶名,一個密碼。然後一個submit按鈕。提交到本頁,加一個參數。
比如
thispage.asp?action=reg
這里的參數是action,值是reg。
在頁的另一部分進行獲取
p = request.querystring("aciton");
if(p=="reg")
{
//這里進行注冊
以剛才傳過來的表單里的username為關鍵字進行SQL查找,看庫里有無這個用戶。如果沒有,則寫入資料庫:剛才的用戶名和密碼。
如果有這個用戶,返回信息,告知用戶該名已被使用。
}
登陸也類似
只不過是先以用戶名作為關鍵字進行查找,然後找不到該用戶名報錯,如果找到,則將其密碼從資料庫中提出,和用戶從表單提交的值進行比較,如果不一致,報錯。如果一致,則通過,登陸成功。
如果是以密文進行保存的密碼,則需要更多處理,你現在根本弄不明白,還是先弄清楚明文密碼吧。

『拾』 HTML登錄注冊怎麼寫才顯得高大上

確切的說,登陸注冊代碼,是由2部分組成
首先,是html元素,具體表單元素(注內冊也好,登陸也好,都需要輸入容框和按鈕提供給用戶輸入他的信息和提交他的信息)
第二部分:需要伺服器端動態語言去處理表單發送來的信息,而這個,由於html是客戶端語言,已經html不具備動態解析功能,所以,html是不可能做得到的。這部分就需要諸如但不限於:asp php asp.net jsp等來進行伺服器端處理

熱點內容
美發店認證 發布:2021-03-16 21:43:38 瀏覽:443
物業糾紛原因 發布:2021-03-16 21:42:46 瀏覽:474
全國著名不孕不育醫院 發布:2021-03-16 21:42:24 瀏覽:679
知名明星確診 發布:2021-03-16 21:42:04 瀏覽:14
ipad大專有用嗎 發布:2021-03-16 21:40:58 瀏覽:670
公務員協議班值得嗎 發布:2021-03-16 21:40:00 瀏覽:21
知名書店品牌 發布:2021-03-16 21:39:09 瀏覽:949
q雷授權碼在哪裡買 發布:2021-03-16 21:38:44 瀏覽:852
圖書天貓轉讓 發布:2021-03-16 21:38:26 瀏覽:707
寶寶水杯品牌 發布:2021-03-16 21:35:56 瀏覽:837