By JOHN Tue, Sep 22, 2020 at 06:47 PM (4 years ago )
Updated On Wed, Nov 09, 2022 at 05:06 PM (2 years ago)
Updated On Wed, Nov 09, 2022 at 05:06 PM (2 years ago)
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= "SELEC...
Read More …
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" cla...
Read More …
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 = mysql...
Read More …