What's new

Help Sana matulongan :(

O s l o

Forum Guru
Elite
Joined
Mar 6, 2020
Posts
2,272
Solutions
9
Reaction
5,025
Points
1,201
i have a reset pw po here and gusto ko sana mavalidate din yong security ques and answer bago magsend ng otp, patulog naman po.
1645953908640.png

paayos naman po code.
Code:
//if user click continue button in forgot password form
    if(isset($_POST['check-email'])){
       
       
        $email = mysqli_real_escape_string($conn, $_POST['email']);
        $check_email = "SELECT * FROM users WHERE email='$email'";
        $run_sql = mysqli_query($conn, $check_email);
        if(mysqli_num_rows($run_sql) > 0){
            $code = rand(999999, 111111);
            $insert_code = "UPDATE users SET code = $code WHERE email = '$email'";
            $run_query =  mysqli_query($conn, $insert_code);
            if($run_query){
                $subject = "Complete your password reset request";
                $message = "
                Hi $email,
               
                Your password reset code is  $code
               
               
                If you did not ask to reset your password ignore this message.
               
                With regrads,
                The Kamote Team";
                $sender = "From: my_gmail@gmail.com";
                if(mail($email, $subject, $message, $sender)){
                    $info = "We've sent a password reset otp to your email - <b> $email </b>, Check your spam or junk folder if you don’t see the email in your inbox";
                    $_SESSION['info'] = $info;
                    $_SESSION['email'] = $email;
                    header('location: reset-code.php');
                    exit();
                }else{
                    $errors['otp-error'] = "Failed while sending code!";
                }
            }else{
                $errors['db-error'] = "Something went wrong!";
            }
        }else{
            $errors['email'] = "This email address does not exist!";
        }
     }

1645954080126.png


patulooooooong po pls
 

Attachments

Last edited:
learn basics ng php para malaman mo ano gagawin mo dyan.. ww3.schools ka mag read ng tut or yt. matagal pero mas magagamit mo sa iba pang task na ipapagawa. learn din ng basic programming.
 
learn basics ng php para malaman mo ano gagawin mo dyan.. ww3.schools ka mag read ng tut or yt. matagal pero mas magagamit mo sa iba pang task na ipapagawa. learn din ng basic programming.
nahihirapan po kasi ako nagseself study naman kaso hirap e, di naman po kasi tayo same na madali matuto.
 
nahihirapan po kasi ako nagseself study naman kaso hirap e, di naman po kasi tayo same na madali matuto.
same lang din po.. mahirap talaga ang bagay pag di mo binibigyan ng oras.. panahon lang kailangan mo.. saka bat ka nag it if its not what you like. isa sa core ng it ang coding kaya kahit basic lang pwedi mo naman matutunan. madami naring tut sa yt kaya di mo na masasabing mahirap yan..

hard work ts. yun need para maging successful.
 

Similar threads

Back
Top