PHP security & SQL security - How to avoid a PHP hack attack?

Discussion in 'PHP' started by rahulephp, Oct 5, 2009.

  1. #1
    Hi there,
    First of all i want to let you know that, my experience with this forum is really very good.

    I am new php programmer and i have intend knowledge of PHP & mysql.

    Before some days, i did notice that someone was tried to hack my website using SQL injection.

    If you run a content website (no e-commerce) that uses php and a mysql database,
    • what security programming measures can you take to ensure that someone doesn't hack / deface / erase your site and its data?
    • what security programming measures can you take to ensure that someone doesn't hack / deface / erase your site and its data?
    i don't think that all of the host's job.
    • what are some typical mistakes that programmers do that leave themselves to hacking?
    • what can a programmer do on the coding end?
    • how can we avoid a php hack attack?

    I think, Things like SQL Injection are worth looking into.

    can you please let me know about security with SQL injection.

    Expecting good help from you & Thank you in anticipation.
     
    rahulephp, Oct 5, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Read the sticky thread, there are lots of tips in there.
     
    premiumscripts, Oct 5, 2009 IP
  3. almondj

    almondj Peon

    Messages:
    768
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Sometimes an effective way to slow down hackers is to have more than one DB with different credentials. Always mysql_real_escape_string(YOUR_INPUT);!
     
    almondj, Oct 5, 2009 IP
  4. Mechanical

    Mechanical Banned

    Messages:
    657
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #4
    I was away for few weeks now. So didn't saw your message. Sorry for being late to respond.

    What I was trying to say is you keep the db details inside a separate file and include that file inside the file which you display to the user. So users will be knowing only about the files they see in the browser. Also use POST method. To avoid spamming or bots activity make use of captcha.
     
    Mechanical, Oct 28, 2009 IP