Jump to content

Injections.


timmy0320

Recommended Posts

Well first off, let me say that I've used search a lot on this topic. Google, etc. Read up on a lot of ways to stop SQL Injections. But what my question is, I have on my registration page is email formatting check, usernames are alphanumeric only, all the works. It also has inputs for a Referral, First Name, Last Name and Security Question answer. I tried injecting my site with the "common" injections that I've found through browsing. What I use is stripslashes(trim()). Until I put an "or die();" feature after the insert it just wasn't inserting the user because of my attempts to inject it. What I did was test the insertions and when I used common injections the or die(); would show. The message I put into it was "hack attempt." I tested it with other characters such as !@#$%(^&)*" and it only does the die when I actually insert an injection.

 

My question is just simple, is stripslashes(trim()); a good way to prevent injections or should I use other formatting?

 

Also, should I leave the or die(); at Hack attempt or just put Error Registering? lol.... :D

 

$answer = stripslashes(trim($_POST['answer']));

Link to comment
Share on other sites

Read that somewhere also. Everyones got plenty of different ways, I've seen a bunch of different things but I've been learning a lot of stuff from here and php.net by reading and you guys have the best knowledge I've seen for a forum. Thanks for the help. Anyone else have more suggestions, send em!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.