1.8K Views
In previous post we design the login form, so finally implement PHP code // LOG USER IN if (isset($_POST['login_btn'])) { $email = esc($_POST['email']); $password = esc($_POST['password']); $time=time()-60; $ip_address=getIpAddr(); $check_login_result= "SELECT count(*) as total_count from login_log WHERE try_time&g...
Upload and save a file in to a database using PHP and MySQL. let's implement upload a file. create an upload form input file type <form method="post" action="" enctype="multipart/form-data"> <input type="file" name="File" id="File"> <button type="submit" class="btn" name="btn-upload">Upload</i></button> </form&g...
First when a user logged in put the logged in user in to a session $sql = "SELECT * FROM users WHERE (email='$email' OR username='$email') AND password='$password' LIMIT 1"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { $row = mysqli_fetch_assoc($result); // get id of created user ...