Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*------------------MYSQL INFO------------*/
- <?php
- $db_host = 'localhost';
- $db_user = 'root';
- $db_password = '';
- $db_name = 'vvp';
- $db_connection = @mysqli_connect($db_host, $db_user, $db_password, $db_name)
- OR die('Ivyko klaida jungiantis i duomenu baze: ' .mysqli_connect_error());
- ?>
- /*------------------MYSQL INFO------------*/
- /*-----------------INDEX.PHP------------*/
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
- <title>VVP SISTEMA</title>
- <!-- Bootstrap -->
- <link href="css/bootstrap.min.css" rel="stylesheet">
- <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <br><br>
- <div class="container">
- <div class="header clearfix">
- <h3 class="text-muted">VVP SISTEMA</h3>
- <center><h4 class="text-muted">PRISIJUNGIMAS</h4></center>
- </div>
- <div class="jumbotron">
- <form action = 'login.php' method = 'POST'>
- <!--<center><input type='text' name='username'></center><br> -->
- <center><input type="text" name='username' class="form-control" placeholder="Vartotojo Vardas" required="" autofocus=""><br></center>
- <center><input type="password" name='password' class="form-control" placeholder="Slaptažodis" required="" autofocus=""><br></center>
- <br>
- <button class="btn btn-lg btn-info btn-block" type="submit">Prisijungti</button>
- </form>
- </div>
- <footer class="footer">
- <p>© Arnas V. 2015</p>
- </footer>
- </div>
- <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
- </body>
- </html>
- /*------------------------------INDEX.PHP-----------------*/
- /*---------------------------LOGIN.PHP-------------------*/
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
- <title>VVP SISTEMA</title>
- <!-- Bootstrap -->
- <link href="css/bootstrap.min.css" rel="stylesheet">
- <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- </html>
- <?php
- require_once('mysqli_connection.php');
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($username && $password){
- $query = "SELECT * FROM playerdata WHERE name='$username'";
- // Execute the query with mysql_query()
- $result = mysqli_query($db_connection,$query);
- // $result is a result resource that can be passed
- // to mysql_num_rows() unless the query failed and $result is FALSE
- if ($result && mysqli_num_rows($result) != 0) {
- while($row = mysqli_fetch_assoc($result)){
- $dbusername = $row['name'];
- $dbpassword = $row['password'];
- if($password == $dbpassword){
- $dbemail = $row['email'];
- $dbskin = $row['skin'];
- $dbmoney = $row['money'];
- $dbxp = $row['xp'];
- $dbhp = $row['health'];
- $dbarmour = $row['armour'];
- $dbcar = $row['car1'];
- $dbcar2 = $row['car2'];
- $_passCount = 0;
- $_passSize = strlen($dbpassword);
- ?>
- <h2><br><br></h2>
- <div class="jumbotron">
- <center><h2>Žaidejo informacija</h2></center><br>
- </html>
- <?php
- echo
- "
- <center><h4>Vartotojo vardas: $dbusername<br>
- Slaptažodžis: ";
- while($_passCount != $_passSize){
- echo '•';
- $_passCount = $_passCount + 1;
- }
- echo
- "<br>El.paštas: $dbemail<br>
- Patirtis: $dbxp XP<br>
- Gyvybės: $dbhp <br>
- Šarvai: $dbarmour <br>
- Žaidėjo išvaizdos ID: $dbskin<br>
- Pinigai: $dbmoney $<br>";
- if($dbcar > 0){
- echo "Pirmos mašinos ID: $dbcar<br>";
- }
- else{
- echo "Pirma mašina: nėra<br>";
- }
- if($dbcar2 > 0){
- echo "Antros mašinos ID: $dbcar2<br>";
- }
- else{
- echo "Antra mašina: nėra<br>";
- }
- }
- else{
- echo 'Neteisingas slaptažodžis!';
- }
- }
- }
- else{
- echo '<center><b>Tokio žaidėjo nėra!</b></center>';
- }
- }
- else{
- echo 'Neįvedete vardo arba slaptažodžio';
- }
- ?>
- /*--------------------------LOGIN.PHP-------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement