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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:09:56+00:00 2026-05-23T05:09:56+00:00

i was trying to check a web site for an sql injection attack and

  • 0

i was trying to check a web site for an sql injection attack and amazed to see it not very very simple to prevent because below is the simple code .

$sql="select * from user_acount where login_id='".$username."' and password='".$password."' and status='1' ";

i can not do any sql injection to test it. i wrote the following

1st Attempt to check sql injection

Login:  admin'--
Password:'i typed nothing here '

Result Wrong password you cannot login.

2nd:

Login:  admin or 1=1 --' 
Password:''

Result Wrong password you cannot login.

3rd:

Login:  admin' or 1=1 
Password:''

4th:
Login: admin or 1=1′–
Password:”

Result Wrong password you cannot login.

Can anyone please explain what is stopping me ? i am not using prepared statements nor i am using any filter class neither i have real_escape_string ?

  • 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-23T05:09:57+00:00Added an answer on May 23, 2026 at 5:09 am

    Two possibilities:

    1. There is no login_id with admin, therefore the query looks like:

      select * from user_acount where login_id='admin'
      
    2. magic_quotes have been enabled, resulting in queries like:

      select * from user_acount where login_id='admin\'--' and password='' and status='1'
      select * from user_acount where login_id='admin or 1=1 --\'' and password='' and status='1'
      

      The last query will always fail, even if magic quotes was turned off:

      select * from user_acount where login_id='admin or 1=1 --'' and password='' and status='1'
      

      Because -- comments within strings do not work, the query is interpreted like:

      select * from user_acount where login_id='STRING'' and password='' and status='1'
      

      As you can see, this will result in a syntax error after 'STRING'

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

Sidebar

Related Questions

I'm trying to create a Palm OS app to check a web site every
Okay so I have this web site search script and I'm trying to count
I have created a website from File->new-> Web Site. i am trying to go
I'm trying to make a web service secure. It's not for a bank or
I'm trying to make a setup program for an ASP.NET web site. I need
In IIS 6, I am trying to deploy a Web Site project from Visual
What is a good site to check current web usage statistics -- particularly Java
I'm trying to post some very simple data to a php file using jquery
I am working on my web site and I am trying to implement a
Trying to manage access to a web site I created some necessary entities 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.