In this lecture, we will create a result every page, if the given request is post and it has hostname
IP address and resolved parameters.
We will save the result into the database according to the given parameters.
So let's start calling.
Open up your 8:00 AM editor and create a new file.
I will call it the.
Results that be an insight they get results that open your tax and include can be filed because people
will be using the magical variable of that file.
So let's create an if statement if the given request method.
This post.
And if it has hostname
IP address.
And a result parameter.
We will send security to databased in order to save the result value into our database.
Let's create an escape prepared statement in order to send this guy Koorie, I will call it take results
security and it will be prepared insert, insert, insert into.
Or actually, we can use the update function, just use the update function.
No need to use insert here update victims said command.
Results.
Is it cool to question mark?
Where first name is Questionmark and IP address is it goes to questionmark.
We will be replacing those question marks with given parameters.
So let's replace them.
All of them will be strong data types, such as.
And replace the first question might be the hostname parameter and the second one with a parameter and
third one with the result
and execute the query.
Yep, that's it.
So let's test out called.
By using Carl.
It is an old terminal, they have used open a new terminal.
And use can't comment, so we need to set hostname IP and resolve parameters, so the result will be.
Test result, and we will send a positive quest to get results that people this post request will be
coming from the victim, so we are stimulating it.
And let's connect database and check if the result has been said, if result has been inserted into
a database.
As you can see, the common a common result is still mild, so there was a problem.
Let's fix this.
We have.
Hostname parameter in the code.
Let's check the parameters hostname.
The IP address, IP address is Bede's, all right, and we have the result, a result parameter, which
is a test result.
So if things are seems fine.
So then what's the problem of the victims said common result.
The column names Wollard.
The table name victims is what it so seems like.
The problem is the first question mark needs to be replaced with the result, but I made it hostname,
so change it.
And the second one will be the hostname and the third one will be the IP address.
And try to use the car, request again, request again.
And let's see.
Now, as you can see, the test result has been inserted to database, so we have completed our task.
That's it for this lecture.
See you in the next one.