Today will be how to secure your website from XSS injections. Injections are ways for hackers to break your website. Fortunately, they are easily prevented with a few lines of code.
What are injections?
Injections are when you allow users to submit anything to your site without filtering the data.
Hi guys, I've got a special tutorial this week. A friend of mine asked me what is a firewall and how do they work? I decided it would be a nice idea to make it into a tutorial. Computers, hackers, firewalls and the internet. How do they work?
The internet and your computer
So how does your computer interact with the internet? Your computer uses ports to allow programs to go in and out.
Today's lesson builds upon last week's lesson on forms. Actually, this lesson should have been first to grab the data before validation. Oh well, no harm no foul. Anyways, there are two ways to send data through PHP: GET and POST. They are relatively simple to use.
What is Post?
POST is data sent through a form.
As our first project, I'll show how to validate a form. I'll use a simple contact form for this demonstration.
First let's create a form that allows our users to enter data. It will contain simple information like name, comment, email, and website. It's important that the file name is the same as the form's action.
I'm going to show you how to match and replace different statements in variables.
What are regular expression?
Regular expressions are patterns that PHP recognizes. Common statements on the web all have the same patterns. URLs always start with http://______.___ or https://______.___ and emails look like ______@____.