Page Not passing variables as it did

If it works locally then create a new account using the correct PHP version to see if it works fine again when hosted online?

So I rest the site and now I am trying to import mysql files but it tells me that I cannot import them because I don’t have access yet its the only way I know to access the database every heard of that?

I figured that out but now I get a 1044 error code when I try to log in

check this page on How to resolve a 1044 Access Denied error in MySQL

https://www.webhostinghub.com/help/learn/website/databases/mysql-1044-error-message

note, if you had any problem regarding to coding issues you should first google it cuz when you google it you will find the answer for your very fast
and this is where most developer like to go to find answers for there problems


and
https://www.quora.com/
here is where people post about hosting problem.

Have you got access back? @Pittsie84

Trust me I have been googling things but some of the articles and things get very complicated so I look here for a more simple answer. And when my code randomly stops working without being touched then I assume its something to do with the host not the code

So I looked at the sql code it never tries to create the db. I deleted the old one and redid it and I have the same exact issue

Change that to if(isset($_POST[‘submit’])){

isset is a function within itself. isset(POST/GET Param);

and that code is pretty inefficient to use. play around with this.
<?php
session_start();
class DB
{
private static $instance = null;
public static function get(){
if(self::$instance == null){
try
{
self::$instance = new PDO(‘mysql:host=localhost;port=port;dbname=dbname’, ‘username’, ‘password’);
}catch(PDOException $e)
{
throw $e;
}
}
return self::$instance;
}
}

?>

That is the only time you need to call your database.
Make a class file.

e.g Core.php

<?php

    require('configfilenameabove.php');

    Class Engine{
              public function GetUser($username, password){
                      $stmt = DB::get()->prepare("SELECT * FROM users WHERE username = :u); 
                      $stmt->bindParam(":u", $username); BindParam will provide sanitation.
                      if($stmt->execute()){
                        if($stmt->rowCount() > 0){
                           $new_password = sha1($password); //Or you can return this in another function
                           $row = $stmt->fetch();
                           if($new_password == $row['password']){
                               $_SESSION['member_session'] = $row['id'];
                               return true;
                           }else{
                               return false;
                           }
                       }else{
                         return false;
                       }
                    }else{
                      return false;
                    }
              
    }

You can easily call this function in whatever page by just requiring the core file and the function.
require(‘core.php’);
if(isset($_POST[‘submit’])){
if(Engine::GetUser($username, $password) != false){
header(“location: home.php”); //Cookie is set in the function.
}else{
//do something
}

}