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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:40:48+00:00 2026-05-28T07:40:48+00:00

I am learning sql injections and very interested how to cause this. I have

  • 0

I am learning sql injections and very interested how to cause this.
I have written script to see how it is going. so here is my code =>

if (isset($_POST['act'])){
    if ($connection = mysqli_connect($var['host'],$var['user'],$var['password'],$var['database'])){
        if (mysqli_connect_errno()==0){
            $username = $_POST['username'];
            $password = $_POST['pswd'];
            if ($result = mysqli_query($connection,"SELECT username,password FROM login WHERE username='" . $username . "' AND password='" . $password . "'")){
                if (mysqli_num_rows($result)){
                    header("Location: http://localhost/default.php");
                } else {
                    $res = "Invalid Credentials ...";
                }
            }
        }
    }
}

<form name="action" method="post" action="index.php">
    Username:<input type="text" name="username" size="12"><br>
    Password:<input type="password" name="pswd" size=12><br>
    <input type="submit" name="act" value="Login">
</form>

I’m writing like this in forms, but nothing happening

in username and in password form => some’ OR ‘1’=’1′

I’m very interested how to cause sql injection to break this script and without valid credentials redirect to default.php (of course within from marked script)

Thanks …

  • 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-28T07:40:49+00:00Added an answer on May 28, 2026 at 7:40 am

    Try entering ' OR 1 -- as username

    Also, just in case, chack if you have magic_quotes_gpc disabled 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am still learning SQL so this may seem a very odd question, but
I am learning SQL and am trying to learn JOINs this week. I have
Hi I am interested in learning SQL databases something I should have done a
I'm a newbie, just learning SQL and have this question: I have two tables
I have been slowly learning SQL the last few weeks. I've picked up all
I am just learning sql and starting with PostgreSQL. Here is what I am
I'm learning SQL and I'm having trouble with a query. I have the following
I have a very simple page that is displaying canned data. I experienced this
Just learning about sql joins and things, and I have a question. Can you
I am learning SQL and I have problem with building a query and I

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.