Namespace App Index Controller;
App Common Controller Base verwenden; //Common Controller importieren
Think Db verwenden;
App Index Model verwenden Add as AddModel;
Think Validate verwenden;
Use think Session;
use think Fassade URL;
class Index erweitert Base {
public
function index() {
$s = cookie( 'email' );
if ( is_null( $s ) ) {
return $this->fetch();
} else {
$q = 'Lieber Benutzername und E-Mail-Adresse lautet';
$h = 'Willkommen zurück';
$this->assign ( [ 'email' => $s,
'q' => $q,
'h' => $h,
] );
return $this->fetch( 'user / dlhdym' );
}
}
}
Namespace App Index Controller;
Think Controller verwenden;
App Common Validate verwenden;
App Common Controller Base verwenden;
App verwenden Common Model User as UserModel;
class User erweitert Base {
//Registrierungsseite
public
function register() {
$this->assign( [ 'title' => 'Benutzerregistrierung' ] );
return $this->fetch();
}
public
function insert() {
//Accept data
$data = input( 'post.' );
$ c = $_POST[ 'email' ];
$d = $_POST[ 'mobile' ];
$code = $_POST[ 'code' ];
$c = UserModel::get( [ 'email' = > $_POST[ 'email' ] ] );
$d = UserModel::get( [ 'mobile' => $_POST[ 'mobile' ] ] );
$h = is_null( $c ) ;
$z = is_null( $d );
if ( $h + $z != 2 ) {
echo "<script>alert('Hallo, die E-Mail- oder Mobiltelefonnummer, in der Sie sich registrieren möchten the platform Jemand hat sich bereits registriert, bitte ändern Sie die Informationen');</script>";
return $this->fetch( 'user/register' );
}
if ( !captcha_check( $code ) ) {
echo "<script>alert('Sie haben den Bestätigungscode nicht eingegeben oder der Bestätigungscode ist falsch!');</script>";
return $this->fetch( 'user /register' );
}
$sjh = $_POST[ 'mobile' ];
if ( preg_match( "/^1[34578]{1}d{9}$/", $sjh ) ) { } else {
echo "<script>alert('Keine Handynummer!');</script>";
return $this->fetch( 'user/register' );
exit; ?? ( 'post.' );
unset( $data[ 'password_confirm' ] );
$user = new UserModel( $data );
$a = $user->allowField( [ 'name', ' email', 'mobile', 'password' ] )->save();
if ( $a = 1 ) {
$code = input( 'code' );
echo "<script>alert ('Registrierung erfolgreich, bitte melden Sie sich an und werfen Sie einen Blick darauf!');</script>";
return $this->fetch( 'user/login' );
}
} else {
dump ( $validate->getError () );
}
return $this->fetch( 'user/register' );
}
//Benutzeranmeldung
öffentlich
Funktionsanmeldung() {
$this-> Assign( [ 'title' => 'User login' ] );
return $this->fetch( 'user/login' );
}
public
function loginCheck () {
if ( isset( $_POST[ 'email' ] ) ) {} else {
echo "<script>alert('Bitte bewegen Sie die Adressleiste nicht!');</script> ";
return $this-> restart( 'index/index/index' );
exit;
}
$a = UserModel::get( [ 'email' => $_POST[ 'email ' ] ] );
$b = UserModel::get( [ 'password' => $_POST[ 'password' ] ] );
$c = $_POST[ 'email' ];
$d = $_POST[ 'password' ];
$e = is_null( $a );
$f = is_null( $b );
if ( $c != '' && $d != '' ) {
if ( $f + $e != 1) {
cookie( 'email', $c, 900000 ); // Cookie-Speicherzeit angeben
$s = cookie( 'email' );
if ( $ s = cookie( 'email' ) ) {
$q = 'Lieber Benutzername und E-Mail-Adresse lautet';
$h = 'Willkommen zurück';
echo "<script>alert('Jetzt eingeloggt!' );</script>";
$this->assign( [ 'email' => $c,
'q' => $q,
'h' => $h,
] );
return $ this->fetch( 'user/dlhdym' );
}
} else {
echo "<script>alert('邮箱或密码错误');</script>";
return $this->fetch( 'user/login' );
}
} else {
echo "<script>alert('您还没有输入邮箱或密码');</script>";
return $this->fetch( 'user/login' );
}
}
}
namespace app\ index\ controller;
use think\ Controller;
use think\ facade\ Url;
use think\ Cookie;
class tt extends Controller {
public
function index() {
cookie::delete( 'email' );
return $this->fetch( 'index/index' );
}
}
{include file="public:header"/}
{include file="index:nav"/}
{include file="public:right"/}
{include file="public:footer"/}
{include file="public:header"/}
{include file="public:nav"/}
{include file="public:right"/}
{include file="public:footer"/}
{include file="public:header"/}
{include file="public:nav"/}
{include file="public:right"/}
{include file="public:footer"/}