#4 Make Register Page Functional PHP | Complete User Registration & Login System Using PHP & Ajax

preview_player
Показать описание
Hello guyz! In this video tutorial I'm showing you how to make registration page working using PHP. In this video we will first check for unique username and email availability using PHP Mysqli Prepared Statement. And then we will insert our register form details into the database.

I'm developing a complete series of User Registration and login system with remember me & forgot password using bootstrap 4, PHP, Ajax & MySQLi Object Oriented. (Prepared Statement).

If you like my works and my video tutorials then you can donate me some amount. You can donate through these links :



Thanks for watching this video. If you like this video then hit like button, share this video, And Subscribe my Channel. Also like my Facebook page for latest updates.

-~-~~-~~~-~~-~-
Please watch: "#1 Payment Gateway Integration Using PHP (Instamojo) | Introduction Video"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

Gives me something wen wrong and I think from the ID auto,  Fatal error: Uncaught Error: Call to a member function bind_param() on boolean

gameandfun
Автор

Notice: trying to acess array offset on value of type null in action.php
What is this?

pratimarai
Автор

I need your help I want to upload profile picture through this registration form.. how to do that ?

iamsourin
Автор

My database is not connecting with action page while in config page it shows success

pratimarai
Автор

I have successfully registered a user but im unable to register another. Whenever i try to register a new user, I always get this error message "Something went wrong, please try again". What could be the problem? I also noticed on phpmyadmin that the first user id is displaying 0 instead of 1

ovieolori
Автор

Hi i am trying to make this page work but it says something went wrong and also no error on google console. I have checked to codes several times and no luck. The first three tutorial were fine and working as you showed us but this one i dont know what is the problem can you please help me with that. Thanks

My code;

<?php
require 'config.php';
if(isset($_POST['action']) && $_POST['action'] == 'register'){





$pass=sha1($pass);
$cpass=sha1($cpass);
$created=date('Y-m-d');

if($pass!=$cpass){
echo 'Password did not matched!';
exit();
}
else{
$sql=$conn->prepare("SELECT username, email FROM users WHERE username=? OR email=?");
$sql->bind_param("ss", $uname, $email);
$sql->execute();
$result=$sql->get_result();


if($row['username']==$uname){
echo 'Username not acailable try differrent!';
}

echo 'Email is already registed try different!';
}
else{
$stmt=$conn->prepare("INSERT INTO users (name, username, email, pass, created) VALUES (?, ?, ?, ?, ?)");

if($stmt->execute()){
echo 'Registered Succesfully. Login Now!';
}
else {
echo 'Someting went wrong.Try again!';
}
}
}
}
function check_input($data){
$data=trim($data);
$data=stripslashes($data);

return $data;
}
?>

alperem
Автор

Guys, you should not follow a tutorial where the guy even does the ajax part wrong but claim to train about a "complete secure" login form. He did not even used jquery.validate's submitHeader. So you can submit the form when just the HTML setting is valid, equalTo will get ignored. Aswell any better validation made via jquery.validate gets ignored. He used a library TO NOT REALLY USE IT at the Aswell why you don't use PDO?

Takio
Автор

Having trouble executing a SELECT query in a prepared statement. I've tried all ways but no solutions working for me . Can your please check it ?

if($pass!= $cpass){
echo "Password did not matched!";
exit;
}
else{
$sql = $conn -> prepare("SELECT username, email FROM users WHERE username=? OR email = ?");
$sql -> bind_param('ss', $uname, $email);
$sql -> execute();
$result = $sql -> get_result();
$row=$result -> fetch_array($sql, MYSQLI_ASSOC);

if ($row['username'] == $uname) {
echo "Username not availabe try different";
}
elseif ($row['email']==$email) {
echo "email is already taken diiferent";
}
else {
$stmt = $conn -> prepare("INSERT INTO users (username, email, pass, created) VALUES (?, ?, ?, ?)");
$stmt -> bind_param('ssss ', $username, $email, $pass, $created);
if ($stmt->execute()) {
echo "Registrated sucessfully. Login Now!";
$stmt->close();
$conn->close();

}
else {
echo "Something went wrong. Please try again";
}
}
}

This is not working for me.

JaiKumar-mxdo
Автор

sir same to same code but data not insert error 'Username not available try different' my code sent your gmail please check

ShahzaibKhan-whhh
Автор

HI!
I just got this error message:

Notice: Trying to access array offset on value of type null in on line 24

Notice: Trying to access array offset on value of type null in on line 27
Something went wrong. Please try again.


so...what happened here?

BTW, your tutorial is great! :)

christopherjohnmortal