Form Submit form to database

Source: Internet
Author: User

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title> Login Angularjs</title>
<meta charset= "UTF-8" >
<meta name= "viewport" content= "Width=device-width, Initial-scale=1,maximum-scale=1,user-scalable=no" >
<link rel= "stylesheet" href= "Css/bootstrap.min.css" >
<link rel= "stylesheet" href= "Css/login.css"/>
<body>
<div class= "Container" >
<div class= "Img-responsive" ></div>
<form class= "Form-signin" id= "Form1" method= "Post" action= "login.php" >
<label class= "sr-only" for= "Inputemail" >email address</label>
<input id= "Inputemail" class= "Form-control" placeholder= "Email Address" required= ""
autofocus= "" type= "email" name= "email"/>
<label class= "sr-only" for= "Inputpassword" >Password</label>
<input id= "Inputpassword" class= "Form-control" placeholder= "Password" required= ""
autofocus= "" type= "password" name= "password"/>
<div class= "checkbox" >
<label>
<input value= "rember-me" type= "checkbox"/>
Remeber me
</label>
</div>
<button class= "btn btn-lg btn-primary btn-block" >sign in</button>
</form>
</div>
</body>


<?php
Header ("Content-type:text/html;charset=utf-8");
/* $mysql _username= "localhost"; Connect to database user name
$mysql _password= ""; Connect Database Password */
$mysql _database= "Test"; The name of the database

Connecting to a database
$conn = mysql_connect (' localhost ', ' root ', ') or Die ("Mysql_connect:". Mysql_errno ());
mysql_select_db ($mysql _database);
$email =$_post[' email '];
$password =$_post[' password '];
if (Isset ($email)) {
$sql = "INSERT into ' login ' VALUES (' $email ', ' $password ')";

$query = mysql_query ($sql);
if ($query) {
echo ' 1 ';
}else{
Echo ' registration failed! ';
}
}

?>

Form Submit form to database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.