Guest User

Untitled

a guest
Jun 26th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. import React,{Component} from 'react';
  2. import "./LoginView.css";
  3. import logo from './resources/images/User.svg'
  4.  
  5. class LoginView extends Component{
  6. render(){
  7. return(
  8. <div className={"LoginView"}>
  9. <div id="LoginView">
  10. <img className="LoginImage" src={logo} alt={"logo"}/>
  11. <form id="LoginForm" action="index.php" method="post" >
  12. <input type="text" id="Username" name="Username" placeholder="Username" required/>
  13. <input type="password" id="Password" name="Password" placeholder="Password" required/>
  14. <input type="submit" id="LoginButton" value="Login"/>
  15. </form>
  16. </div>
  17. </div>
  18. );
  19. }
  20. }
  21. export default LoginView;
  22.  
  23. $Username=$_REQUEST["Username"];
  24. $Password=$_REQUEST["Password"];
  25.  
  26. echo $Username,"/",$Password;
  27.  
  28. $Conn=mysqli_connect("localhost","root","password");
  29.  
  30. if(!$Conn){
  31. echo "Errorn";
  32. echo "Try Again<a href='index.html'>Click here</a>";
  33. }
  34. else{
  35. if(!mysqli_select_db($Conn,"users")){
  36. echo "Error.n";
  37. echo "Try Again:<a href='index.html'>Click here</a>";
  38. }
  39. else{
  40. $sql="SELECT * FROM access where username='$Username' and password='$Password'";
  41. }
  42. $result=mysqli_query($Conn,$sql);
  43.  
  44.  
  45. if(mysqli_num_rows($result)>0){
  46. echo "User Accepted!.n";
  47. echo "Continue:<a href='index.html'>Click here</a>";
  48. }
  49. else{
  50. echo "User not accepted!.n";
  51. echo "Try again:<a href='index.html'>Click here</a>";
  52. }
  53. }
  54.  
  55. ?>
Add Comment
Please, Sign In to add comment