Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signup is not working properly. #14

Open
LilPhyziX opened this issue Aug 7, 2023 · 8 comments
Open

Signup is not working properly. #14

LilPhyziX opened this issue Aug 7, 2023 · 8 comments

Comments

@LilPhyziX
Copy link

Hello. When i try to register, i am greeted with this message: Field 'id' doesn't have a default value 1364

I dont know what this means but all i know is its preventing the details to go into the database.

Any help would be greatly appreciated.

Thanks in advance!

@daveh
Copy link
Owner

daveh commented Aug 8, 2023

It looks like you don't have AUTO_INCREMENT set on your id column in the database - this assigns IDs automatically when you insert a new record.

@LilPhyziX
Copy link
Author

LilPhyziX commented Aug 8, 2023

I do have auto increment on though. However i dont see anything in the code that inserts anything into the id

@daveh
Copy link
Owner

daveh commented Aug 8, 2023

Then you don't need to include the id in the list of fields in the insert statement, or in the list of values. New records will be assigned a new value automatically.

@LilPhyziX
Copy link
Author

Alright. I fixed the signup, however the login is not working now.

@LilPhyziX
Copy link
Author

Here is the code for the signin page:

real_escape_string($_POST["email"])); $result = $mysqli->query($sql); $user = $result->fetch_assoc(); if ($user) { if (password_verify($_POST["password"], $user["password_hash"])) { session_start(); session_regenerate_id(); $_SESSION["user_id"] = $user["id"]; header("Location: index.php"); exit; } } $is_invalid = true; } ?>

<!doctype html>

<title>Sign In</title> <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
img CherryBerry Studios
                  <li class="nav-item">
                    <a class="nav-link" href="index.php">Home</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" href="about.html">About Us</a>
                  </li>
    
    
                  <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" role="button" aria-expanded="false">
                      Story
                    </a>
                    <ul class="dropdown-menu">
                      <li><a class="dropdown-item" href="mission.html">Mission</a></li>
                      <li>
                        <hr class="dropdown-divider">
                      </li>
                      <li><a class="dropdown-item" href="vision.html">Vision</a></li>
                      <li>
                        <hr class="dropdown-divider">
                      </li>
                      <li><a class="dropdown-item" href="objective.html">Objective</a></li>
                    </ul>
                  </li>
    
    
                  <li class="nav-item">
                    <a class="nav-link" href="community.html">Community</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" href="support.html">Support</a>
                  </li>
    
                </ul>
                <form class="d-flex ms-lg-5">
    
                  <a href="signup.html" class="btn btn-menu">Sign Up</a>
                </form>
              </div>
            </div>
          </nav>
        </div>
      </div>
    </div>
    

Sign In To Your Account

Let's get started with your account

        <div class="card reg-form pt-3 pb-3">
          <div class="card-body">
    <em>Invalid login</em>
<?php endif; ?>

            <form method="post">
              <p class="mb-2 pt-1 label-fr">Username</p>
              <div class="input-group mb-3 input-group-custom">
                <span class="input-group-text input-group-custom-field">
                  <i class="far fa-user"></i>
                </span>
                <input type="text" class="form-control input-group-custom-field" placeholder="Username" name="email" id="email" value="<?= htmlspecialchars($_POST["email"] ?? "") ?>">
              </div>
              <p class="mb-2 pt-1 label-fr">Password</p>
              <div class="input-group mb-3 input-group-custom">
                <span class="input-group-text input-group-custom-field">
                  <i class="fa fa-lock"></i>
                </span>
                <input type="password" class="form-control input-group-custom-field" placeholder="XXXXXXX" name="password" id="password">
              </div>
              <div class="form-group pt-1">
                <label>
                  <input type="checkbox" required>
                  <span class="rem"> Remember Me </span>
                </label>
              </div>
              <div class="form-group text-center mb-4 mt-3">
                <button type="button" class="btn btn1 ps-4 pe-4 pt-2 pb-2"> SIGN IN </button>
              </div>
              <div class="d-lg-flex justify-content-between links text-center f15">
                <p class="mb-md-0 mb-1">
                  Don't have an account? <a href="signup.html" class="gray text-links">Sign Up</a>
                </p>
                <p class="mb-md-0 mb-1">
                  Forgot Password? <a href="forgot-password.html" class="gray text-links">Reset it</a>
                </p>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

Subscribe to Our Newsletter

Stay updated with the latest news and promotions.

Subscribe
CherryBerry Studios
      <p class="pe-xl-5">
        Duis posuere accumsan neque eu tristique. Sed at enim ultrices, cursus ipsum id, mattis massa.
      </p>
    </div>


    <div class="col-md-6 col-lg-2 pt-4">
      <h5 class="pb-2">
        Quick Links
      </h5>

      <ul class="list-inline list1">
        <li>
          <a href="index.html">
            Home
          </a>
        </li>
        <li>
          <a href="about.html">
            About Us
          </a>
        </li>
        <li>
          <a href="">
            Sign Up
          </a>
        </li>
      </ul>
    </div>
    <div class="col-md-6 col-lg-2 pt-4">
      <h5 class="pb-2">
        Quick Links
      </h5>

      <ul class="list-inline list1">
        <li>
          <a href="index.html">
            Home
          </a>
        </li>
        <li>
          <a href="about.html">
            About Us
          </a>
        </li>
        <li>
          <a href="">
            Sign Up
          </a>
        </li>
      </ul>
    </div>
    <div class="col-md-6 col-lg-4 pt-4">
      <h5 class="pb-2">
        Contact Us
      </h5>

      <ul class="list-inline list1">
        <li>
          <a href="mailto:[email protected]">
            <i class="far fa-envelope"></i>
            [email protected] 
          </a>
        </li>

      </ul>


      <ul class="list-inline  social-list2">
        <li class="list-inline-item">
          <a href="">
            <i class="fab fa-facebook-f"></i>
          </a>
        </li>
        <li class="list-inline-item">
          <a href="">
            <i class="fab fa-twitter"></i>
          </a>
        </li>
        <li class="list-inline-item">
          <a href="">
            <i class="fab fa-youtube"></i>
          </a>
        </li>
        <li class="list-inline-item">
          <a href="">
            <i class="fab fa-instagram"></i>
          </a>
        </li>
      </ul>

    </div>
  </div>
</div>

©2023 - CherryBerry Studios - All rights reserved.

<div id="disclaimer" class="dis-popup">
    <p class="dis-text">This website uses cookies and collects diagnostic data to improve your browsing experience. By continuing to use this site, you consent to the use of cookies and data collection. For more details, please refer to our <a class="gray text-links" href="privacy.html">Privacy Policy</a>.</p>
    <button class="btn btn1 dis-btn" id="acceptButton">Accept & Continue</button>
</div>
Logo

Please Wait...

<script src="assets/js/core.js"></script>

@LilPhyziX
Copy link
Author

Uhm. I dont think it was supposed to display the actual elements

@LilPhyziX
Copy link
Author

I will just upload the file. #
signin.php.txt

@daveh
Copy link
Owner

daveh commented Aug 10, 2023

Please can you describe exactly what the problem is? Do you get any error messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants