<a href="#">Sales</a> </div> <div class="col-xs-4 text-center"> <a href="#">Friends</a> </div> </li> <!-- Menu Footer--> <li class="user-footer"> <div class="pull-left"> <a href="#" class="btn btn-default btn-flat">Profile</a> </div> <div class="pull-right"> <?php require_once 'classes/login.php'; use play_a_sport\classes\login; $nlogout = new login(); ?> <form action="" method="post"> <input type="submit" name="logout" class="btn btn-default btn-flat"/> </form> <?php if (isset($_POST['logout'])) { $nlogout->logout(); } ?> <!-- <a href="" class="btn btn-default btn-flat">Sign out</a>--> </div> </li> </ul> </li> <!-- Control Sidebar Toggle Button -->
<?php session_start(); require_once "classes/login.php"; require_once "classes/db.php"; use play_a_sport\classes\db; use play_a_sport\classes\login; use play_a_sport\classes\config; $user = new login(); $val1 = $_POST["email"]; $val2 = $_POST["password"]; $user->setLogins($val1, $val2); $getvals = $user->getLogins(); $entrduname = $getvals['username']; $entrdpwd = $getvals['password']; //echo $getvals['username']; //echo $getvals['password']; // We need to have 1 config object with all data in. $config = new config("localhost", "root", "", "play_a_sport_db", "", "mysqli"); //type in your data here… // Now we need to have access to the db class, we uses the config object to configure the db object. $db = new db($config); // We can now open the connection to the database. $db->openConnection(); // If your config details are right, we are now connected to a database, lets test the connection before we run queries. $are_we_online = $db->pingServer(); // The variable $are_we_online should be true (or 1) if we are connected to the server. //echo "Are we online: " . $are_we_online; // prints 0 or 1. // Let us run a query. $sql = $db->query("SELECT * FROM {admins}"); // The variable $sql will now hold the data returned from the database, we can now work with it.