Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9086099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:24:23+00:00 2026-06-16T21:24:23+00:00

I have index.php inside in this has modal window with login link. Modal window

  • 0

I have index.php inside in this has modal window with login link. Modal window is with username and password checking in mysql with php. But when I clicked submit button- no typing
username or password it’s not showing php errors – ‘You need to enter a username’ or ‘You need to enter a password’…When is refreshing index.php and I clicked login link it is showing …
How I can resolve this problem on first click on submit button is cheking for mysql php error?

          <div id="basic-modal-content">
            <div id="winsign">

          <form action="" method="post" onSubmit="validate();"> 


           <?php

       include 'core/init.php';


       if (empty($_POST) === false) {
           $username = $_POST['username'];
           $password = $_POST['password'];

       if (empty($username) === true || empty($password) === true) {
        $errors[]= 'You need to enter a username and password';
               } else if (user_exists($username) === false) {
        $errors[]= 'We cant\'t find username. Have you registered?';
        } else if (user_active($username) === false) {
        $errors[]= 'You haven\'t acticated your account!';  
            } else {
        $login = login($username, $password);
        if ($login === false) {
            $errors[] = 'That username/password combination is incorrect';      
            } else {
            $_SESSION['user_id'] = $login;  
            header('Location: sign_in.php');
            exit();
            }
        } 
            print_r($errors);
    }
       ?>


            <span id="tpos">Username:</span><br>
            <input type="text" name="username" class="sbutton" id="modalbox" placeholder="Username">
            <br><br><span id="tpos">Password:</span>
            <br><input type="password" name="password" class="sbutton" id="modalbox" placeholder="Password">
            <br><br><input type="checkbox" name="checkbox" class="cbutton"><span id="ttext">Remember me</span>
            <br><input type="submit" value="Sign In" name="signin" id="bsubmit">
            </input>
            </form>

That is in modal window and when i clicked submit button is not checking for php errors in first click and reload index.php When i clicked second time is there error but in first click is not showing errors and reload page index…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:24:24+00:00Added an answer on June 16, 2026 at 9:24 pm

    I think you’re looking for an onSubmit for your form.

    Try something like this:

    <form name="formname" action="index.php" method="post" onSubmit="validate();">
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an index.php for registration, a login.php as the registration handler. when the
I have an index.php file which has 2 included files require(stats.php); require(stats_encry.php); stats.php which
Let's say i have an index.php that has html in it that looks like
I have this jq function to open a link inside a div: $(document).ready(function() {
This is the structure index.php app/processor.php app/.htaccess in the index.php I have this form
I have a template in joomla without index.php I only have index.html, css file,
I have a index.php page that is the main page. All pages are included
I have a index.php file which loads (require) 2 different files based on a
I have an index page index.php , and when the user clicks on a
I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.