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 6994007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:50:12+00:00 2026-05-27T19:50:12+00:00

I am making a simple login form that saves to a database using MYSQL.

  • 0

I am making a simple login form that saves to a database using MYSQL. I used a tutorial and at the end when I tested it I got an error saying

'Notice: Undefined index: login in C:\wamp\www\database_test\login.php on line 7'

Don’t know what this means and after searching the internet still can’t figure it out. Here is my code. Please help. Thanks!

 <?php

     session_name('MyLogin');
     session_start();
     session_destroy();

     if ($_GET['login'] == "failed") {    //<------This is line 7//
         print $_GET['cause'];
     }

 ?>
 <html>
     <body>
         <form name='login_form' method='post' action='log.php?action=login'>
             Login: <input type='text' name='user'><br />
             Password: <input type='password' name='pwd'><br />
             <input type='submit'>
         </form>
     </body>
 </html>

I basically copied this from a tutorial at

http://www.howtodothings.com/computers-internet/how-to-make-a-login-system-for-your-website

  • 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-05-27T19:50:13+00:00Added an answer on May 27, 2026 at 7:50 pm

    Dylan, I highly suggest that you RTM. If you don’t understand the undefined index error, it’s probably not a good idea to start writing code just yet.

    This is thrown on line 7 (like the error states) at $_GET['login']. This error was thrown because login is not a key found in the $_GET array. Therefore, PHP throws the notice. You can add an isset() or !empty() check to avoid the error, like such:

    if (!empty($_GET['login']) && $_GET['login'] == "failed" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple tool that will get a string of MySQL commands and
So I'm marking up a simple login form using the following html; <form> <label>Username:</label>
I'm making a simple form to create polls, therefore I want the possibility to
I'm making a simple remove link with an onClick event that brings up a
i am making an application with login view. This is just simple UIViewController with
I am making a simple web-app which requires login for the admin page. I
I am making a simple FTP client in Java using standard Java sockets. I
I am making a simple Dynamic Website using PHP, where i allow the user
I'm new to php and am making a simple login system. When someone wants
I was reading this tutorial for a simple PHP login system . In the

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.