Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed PHP & Databases with PDO!
You have completed PHP & Databases with PDO!
Preview
So the key here is to never ever (ever) trust user input. Lets do some validation on our user input and secure our queries.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
One of the great idioms of web security is
filter input, escape output, and
0:00
we'll do just that by using some very
helpful PDO methods.
0:01
Let's take a look at how we can use the
pair and binding to filter out input.
0:04
Now we should know not to trust user
input.
0:10
So we're gonna need to do a lot here.
0:13
But filter filter, filter, filter.
0:16
Let's get rid of all this cuz it's ugly.
0:18
We'll do back to our ID 555, which is
Mallrats United.
0:21
Okay so first step here is to make sure
that this is an integer.
0:26
Now we're not gonna really do any crazy
validation on this.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up