Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * This page permanently deletes the user
- */
- session_start();
- $uname = $_SESSION['name'];
- // DB connection info
- $servername = "tund.cefns.nau.edu";
- $username = "mlb652script";
- $password = "ChelseaFC123";
- $dbname = "mlb652";
- // Making connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Checking connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- // Sql query to change password
- $sql = "UPDATE users SET active = 0 where username = '$uname'";
- // Run query
- if ($conn->query($sql) === TRUE) {
- echo "Record updated successfully";
- } else {
- echo "Error updating record: " . $conn->error;
- }
- session_destroy();
- // Redirect back to homepage
- header("Location: http://cefns.nau.edu/~mlb652/index.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement