日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > > 充電吧
[導(dǎo)讀]<?php //?賬號登錄驗證 function?tableIsExits($tablesName,?$findtablename) { ????$result?=?mysql_query("S

<?php
//?賬號登錄驗證
function?tableIsExits($tablesName,?$findtablename)
{
????$result?=?mysql_query("SHOW?TABLES?FROM?$tablesName");
????$i?=?mysql_num_rows($result);
????if?($i?<?1)?{
????????return?false;
????}

????for?($x?=?0;?$x?<?$i;?$x?++)?{
????????$ret?=?mysql_table_name($result,?$x);
????????if?($ret?==?$findtablename)?{
????????????return?true;
????????}
????}
????return?false;
}

//?選則表單
class?zhClass
{

????public?$zh;
????//?賬號
????public?$mm;
????//?密碼
????public?$con;
????//?數(shù)據(jù)庫句柄
????public?function?checkZh()?//?檢測賬號是否存在
????{
????????$result?=?mysql_query("SELECT?*?FROM?teacher?WHERE?id=$this->zh");
????????if?(mysql_num_rows($result)?!=?0)?{
????????????return?true;
????????}?else?{
????????????return?false;
????????}
????}

????public?function?__construct()?//?構(gòu)造函數(shù)?連接到數(shù)據(jù)庫?打開賬號數(shù)據(jù)表
????{
????????$this->con?=?mysql_connect("localhost",?"root",?"root");
????????mysql_query("set?names?'utf8'");
????????if?(!?$this->con)?{
????????????die('連接服務(wù)器失敗:?'?.?mysql_error());
????????}?else?{
????????????mysql_select_db("mytest",?$this->con);
????????}
????}

????function?logging($id,?$mm)?//?登錄
????{
????????$this->zh?=?$id;
????????$this->mm?=?$mm;
????????if?(!?$this->checkZh())?{
????????????return?false;
????????}
????????//?判斷字段是否存在
????????$result?=?mysql_query("SELECT?*?FROM?teacher?WHERE?id=$id");
????????if?(mysql_num_rows($result)?!=?0)?{
????????????$row?=?mysql_fetch_array($result);
????????????$m_mima?=?$row['mima'];
????????????$name?=?$row['name'];
????????????if?($mm?==?$m_mima)?{
????????????????echo?"登錄成功";
????????????????return?true;
????????????}?else?{
????????????????echo?"密碼錯誤";
????????????}
????????}?else?{
????????????echo?"登錄失敗";
????????}
????????return?false;
????}

????function?_ChangeUserName($mid,?$mm,?$newName)
????{
????????$this->zh?=?$mid;
????????$this->mm?=?$mm;
????????if?(!?$this->checkZh())?{
????????????echo?"賬號不存在!";
????????????return?false;
????????}

????????if?(!?$this->logging($mid,?$mm))?{
????????????return?false;
????????}
?????????echo??$newName?.?","?.?$mm;
?????????//傳過來的是字符串?但是數(shù)據(jù)庫不識別?加上兩個單引號轉(zhuǎn)為字符串?'$newName'
???????$ret=??mysql_query("UPDATE?teacher?SET?name='$newName'?WHERE?id=$mid");
???????if(!$ret)?
???????{
???????????echo?"?無法修改用戶昵稱?";
???????}
????}
????public?function???Reg($zh,$mima,$nichen)
????{
????????$this->zh?=?$zh;
????????$this->mm?=?$mima;

????????if?($this->checkZh())
????????{
????????????echo?"賬號已存在";
????????????return??;
????????}
????????if(mysql_query("INSERT?INTO?teacher?(name,id,mima)?VALUES?('$nichen',$zh,'$mima')")==false)
????????{
????????????echo?"注冊失敗"?;
????????}else{
????????????echo?"注冊成功";
????????}
????}
????public?function?__destruct()?//?析構(gòu)函數(shù)銷毀數(shù)據(jù)庫連接
????{
????????mysql_close($this->con);
????}
}
$pcode?=?$_GET['code'];
$obj?=?json_decode($pcode);
echo??$pcode?.?","?.?$obj->pwd;
$pobj?=?new?zhClass();
if?($obj->type?==?0)?{
????$pobj->logging($obj->id,?$obj->pwd);
}elseif($obj->type==1)
{
????echo?"嘗試修改昵稱**";
????$pobj->_ChangeUserName($obj->id,?$obj->pwd,?$obj->_newName);

}elseif?($obj->type==2){
????$pobj->Reg($obj->id,?$obj->pwd,?$obj->_newName);
}

?>
ApplicationWindow?{
????visible:?true
????width:?640
????height:?480
????title:?qsTr("Hello?World")


????//注冊
????function??regFunc()
????{
????????var??x?=?new?XMLHttpRequest();

????????x.onreadystatechange?=function()
????????{
????????????if(x.readyState?==?4)?{

????????????????if(x.status?==?200)?{
????????????????????console.log("The?server?replied?with:?"?+?x.responseText);
????????????????????txt.text?=?x.responseText;

????????????????}


????????????}
????????};
????????var?xxx?=?new?Object;
????????xxx.id=289672082;
????????xxx.pwd?=?'12345';
????????xxx._newName='阿央0705';
????????xxx.type=2;
??????var?pcode=??JSON.stringify(xxx);
???????x.open("GET","http://localhost/mycode/Test/index.php?code="+pcode);
????????x.send(null);
????}

????function??logging()
????{
????????????????var??x?=?new?XMLHttpRequest();

????????????????x.onreadystatechange?=function()
????????????????{
????????????????????if(x.readyState?==?4)?{

????????????????????????if(x.status?==?200)?{
????????????????????????????console.log("The?server?replied?with:?"?+?x.responseText);
????????????????????????????txt.text?=?x.responseText;

????????????????????????}


????????????????????}
????????????????};
????????????????var?xxx?=?new?Object;
????????????????xxx.id=289672082;
????????????????xxx.pwd?=?'12345';
????????????????xxx.type=0;
??????????????var?pcode=??JSON.stringify(xxx);
???????????????x.open("GET","http://localhost/mycode/Test/index.php?code="+pcode);
????????????????x.send(null);
????}

????????function?_ChangeName()
????????{
????????????var??x?=?new?XMLHttpRequest();

????????????x.onreadystatechange?=function()
????????????{
????????????????if(x.readyState?==?4)?{

????????????????????if(x.status?==?200)?{
????????????????????????console.log("The?server?replied?with:?"?+?x.responseText);
????????????????????????txt.text?=?x.responseText;

????????????????????}


????????????????}
????????????};
????????????var?xxx?=?new?Object;
????????????xxx.id=289672082;
????????????xxx.pwd?=?'12345';
????????????xxx.type=1;
????????????xxx._newName='沫、D';
??????????var?pcode=??JSON.stringify(xxx);
???????????x.open("GET","http://localhost/mycode/Test/index.php?code="+pcode);
????????????x.send(null);
????????}


????Component.onCompleted:?{?
????????regFunc();

????}
????Text?{
????????id:?txt
????????text:?qsTr("text")
????????textFormat:?Text.RichText
????}
????//UPDATE?`teacher`?SET?`name`='hello'??WHERE??id=12
}
本站聲明: 本文章由作者或相關(guān)機構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。
換一批
延伸閱讀

摘 要:“Apache+php+ MySQL”組成了一套完整的開發(fā)B/S架構(gòu)的網(wǎng)絡(luò)信息系統(tǒng)的工具。文中以該套工具開發(fā)產(chǎn)品售后服務(wù)管理系統(tǒng)為例,介紹了開發(fā)過程中的技術(shù)難點及解決方法。

關(guān)鍵字: Apache php MySQL 產(chǎn)品售后服務(wù)管理系統(tǒng)

PHP 7.4.9 版本現(xiàn)已發(fā)布,具體更新內(nèi)容如下:Apache:修復(fù)了錯誤#79030(升級 apache2handler 的 php_apache_sapi_get_request_time 以返

關(guān)鍵字: php

如果使用美國服務(wù)器創(chuàng)建網(wǎng)站,則必須在美國服務(wù)器系統(tǒng)上創(chuàng)建環(huán)境。 今天,我將介紹美國服務(wù)器Linux系統(tǒng)的工作方式。

關(guān)鍵字: apache Linux php

近日消息,PHP 8.0將于11月發(fā)布,但當(dāng)這個重要的新版本出現(xiàn)時,它遇到了很大的挫折,Windows將不支持它,原因未知。

關(guān)鍵字: php Windows 微軟

2020 年 6 月 8 日,PHP 迎來了自己的 25 周歲生日。JetBrains 在博客中梳理了該語言自 1995 年誕生以來的種種歷程,這種語言最初是用 C 語言編寫的一組通用網(wǎng)關(guān)接口(C

關(guān)鍵字: php

#include void TQmlHelper::makeDoc( QQuickTextDocument* doc) { jAVA_QMessage("開始"); QT

關(guān)鍵字: qtquick

function logging() { var x = new XMLHttpRequest(); x.onre

關(guān)鍵字: php

C++需要實現(xiàn)PHP端的:bin2Hex函數(shù),PHP通過這種類型的字符串調(diào)用:pack轉(zhuǎn)換成PHP能識別的2進制數(shù)據(jù)。 C++需要做的是實現(xiàn)一個bin2hex,其實只是把c++讀取的2進制數(shù)據(jù)當(dāng)成b

關(guān)鍵字: C語言 php

方法一: 在 php 端 header('HTTP/1.1 204 No Content '); 利用http的原理進行 方法二:利用src圖片加載的特性完成請求 寫一個函數(shù),函數(shù)體內(nèi) var i

關(guān)鍵字: php

php與nginx整合 PHP-FPM也是一個第三方的FastCGI進程管理器,它是作為PHP的一個補丁來開發(fā)的,在安裝的時候也需要和PHP源碼一起編譯,也就是說PHP-FPM被編譯到PHP內(nèi)核中,因

關(guān)鍵字: nginx php
關(guān)閉