Yam Code
Sign up
Login
New paste
Home
Trending
Archive
English
English
Tiếng Việt
भारत
Sign up
Login
New Paste
Browse
<!DOCTYPE html> <html> <head> <title>đăng kí</title> <meta charset="utf-8"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script language="javascript" src="http://code.jquery.com/jquery-2.0.0.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".submit").click(function(){ $.post("http://localhost/web_nhacj/đăng kí.php",{ username : $("#username").value, password : $("#password").value, dateOfBirth : $("#dateOfBirth").value, name : $("#name").value, class : $("#class").value, email : $("#email").value, major : $("#major").value, sex : $("#sex").value }, function (result){ $('#result').html(result); if(string(result)=="1"){ alert("Đăng Nhập Thành Công ! Bạn Sẽ Được Chuyển Hướng Tới Trang Chủ !"); header("Location: http://localhost/web_nhacj/"); } else{ alert(result); } }); }); }); </script> </head> <style type="text/css"> *{ padding:0px; margin: 0px; } .container { max-width: 1000px; width: 100%; height: auto; margin :0px auto; background: } a{ text-decoration: none; color: #51605e; height: 30px; line-height: 30px; display: block; width: 15%; cursor: pointer; } .input{ width: 80%; height: 40px; margin-top: 1%; margin-bottom: 3%; border-radius: 5px; font-size: 20px; } .submit{ width: 10%; height: 40px; margin-top: 1%; margin-bottom: 1%; border-radius: 5px; background: #45c7ef; } div h2{ display: block; background: #f46242; color: white; width: 30%; margin-top: 2%; text-align: center; } </style> <?php require "library.php"; if(isset($_POST['submit'])){ $username= isset($_POST['username']) ? $_POST['username'] : ''; $password= isset($_POST['password']) ? $_POST['password'] : ''; $name= isset($_POST['name']) ? $_POST['name'] : ''; $dateOfBirth = isset($_POST['dateOfBirth']) ? $_POST['dateOfBirth'] : ''; $class = isset($_POST['class']) ? $_POST['class'] : ''; $email = isset($_POST['email']) ? $_POST['email'] : ''; $sex = isset($_POST['sex']) ? $_POST['sex'] : ''; $major = isset($_POST['major']) ? $_POST['major'] : ''; if($username==''||$password==''||$name==''||$dateOfBirth==''||$class==''||$email==''||$sex==''||$major=='') die("vui lòng điền đủ thông tin !"); if(check_pass($password)) die("Mật khẩu không được chứa kí tự đặc biệt"); if(check_email($email)) die("email không hợp lệ "); $setResuil=""; $db_database="database_anh_tuan"; $db_connect=new PDO('mysql:host=localhost;dbname=database_anh_tuan','root',''); $db_table="user"; $sql="SELECT * FROM user WHERE username= :username"; $db_record=$db_connect->prepare($sql); $db_record->bindParam(':username',$username); $db_record->execute(); $setResuil=$db_record->fetch(PDO::FETCH_ASSOC); if($setResuil){ die("Username đã tồn tại trong hệ thống"); } $sql=$db_connect->prepare("INSERT INTO `user` (`username`,`password`,`name`,`dateOfBirth`,`class`,`email`,`sex`,`major`) VALUES (:username,:password,:name,:dateOfBirth,:class,:email,:sex,:major)"); $value=array('username'=>"$username",'password'=>"$password",'name' => "$name" ,'dateOfBirth' => "$dateOfBirth" , 'class'=> "$class" , 'email' => "$email" , 'sex' => "$sex" , 'major' => "$major"); $sql->execute($value); die("1"); } ?> <body> <div class="container"> <h1>Đăng kí</h1><br> <form action="đăng kí.php" method="post"> <label>USERNAME</label><br> <input type="text" name="username" placeholder="nhap username" id="username" class=""><br> <label>PASSWORD</label><br> <input type="password" name="password" placeholder="nhap password" id="password" class="input"><br> <label>DATE OF BIRTH</label> <input type="date" name="dateOfBirth" id="dateOfBirth" > <label>NAME</label> <input type="text" name="name" id="name"> <label>CLASS</label> <input type="text" name="class" id="class"> <label>EMAIL</label> <input type="email" name="email" id="email"> <label>MAJOR</label> <input type="text" name="major" id="major"> <label>SEX</label> <p>Please select your gender:</p> <input type="radio" name="sex" value="male" id="sex"> Male<br> <input type="radio" name="sex" value="female" id="sex"> Female<br> <input type="submit" name="submit" value="Đăng Kí" class="submit" ><br> <a href="đăng nhập.php" class="link_dangnhap">Trở về trang đăng nhập</a> </form> </div> </body> </html>
Paste Settings
Paste Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax Highlighting :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Paste Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create New Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English
Tiếng Việt
भारत