1 00:00:00,850 --> 00:00:09,310 In this lecture, we will create a result every page, if the given request is post and it has hostname 2 00:00:09,310 --> 00:00:11,560 IP address and resolved parameters. 3 00:00:12,040 --> 00:00:15,970 We will save the result into the database according to the given parameters. 4 00:00:18,570 --> 00:00:20,490 So let's start calling. 5 00:00:22,470 --> 00:00:25,620 Open up your 8:00 AM editor and create a new file. 6 00:00:27,000 --> 00:00:28,580 I will call it the. 7 00:00:33,260 --> 00:00:46,010 Results that be an insight they get results that open your tax and include can be filed because people 8 00:00:46,010 --> 00:00:51,110 will be using the magical variable of that file. 9 00:00:52,910 --> 00:01:00,680 So let's create an if statement if the given request method. 10 00:01:02,860 --> 00:01:03,760 This post. 11 00:01:08,190 --> 00:01:12,890 And if it has hostname 12 00:01:19,150 --> 00:01:20,220 IP address. 13 00:01:25,020 --> 00:01:29,220 And a result parameter. 14 00:01:33,340 --> 00:01:40,720 We will send security to databased in order to save the result value into our database. 15 00:01:43,030 --> 00:01:53,280 Let's create an escape prepared statement in order to send this guy Koorie, I will call it take results 16 00:01:53,280 --> 00:02:05,560 security and it will be prepared insert, insert, insert into. 17 00:02:07,860 --> 00:02:11,640 Or actually, we can use the update function, just use the update function. 18 00:02:11,970 --> 00:02:21,150 No need to use insert here update victims said command. 19 00:02:22,770 --> 00:02:23,460 Results. 20 00:02:25,970 --> 00:02:28,160 Is it cool to question mark? 21 00:02:29,400 --> 00:02:37,680 Where first name is Questionmark and IP address is it goes to questionmark. 22 00:02:38,730 --> 00:02:41,940 We will be replacing those question marks with given parameters. 23 00:02:43,710 --> 00:02:45,790 So let's replace them. 24 00:02:50,190 --> 00:02:53,190 All of them will be strong data types, such as. 25 00:02:54,440 --> 00:03:03,610 And replace the first question might be the hostname parameter and the second one with a parameter and 26 00:03:03,620 --> 00:03:05,180 third one with the result 27 00:03:09,950 --> 00:03:11,600 and execute the query. 28 00:03:16,540 --> 00:03:17,910 Yep, that's it. 29 00:03:21,880 --> 00:03:24,850 So let's test out called. 30 00:03:25,820 --> 00:03:27,140 By using Carl. 31 00:03:29,620 --> 00:03:34,720 It is an old terminal, they have used open a new terminal. 32 00:03:39,300 --> 00:03:54,240 And use can't comment, so we need to set hostname IP and resolve parameters, so the result will be. 33 00:03:57,860 --> 00:04:08,720 Test result, and we will send a positive quest to get results that people this post request will be 34 00:04:08,720 --> 00:04:11,390 coming from the victim, so we are stimulating it. 35 00:04:13,800 --> 00:04:24,210 And let's connect database and check if the result has been said, if result has been inserted into 36 00:04:24,210 --> 00:04:24,930 a database. 37 00:04:38,170 --> 00:04:45,420 As you can see, the common a common result is still mild, so there was a problem. 38 00:04:46,300 --> 00:04:47,320 Let's fix this. 39 00:04:50,600 --> 00:04:51,140 We have. 40 00:04:52,200 --> 00:04:54,310 Hostname parameter in the code. 41 00:04:54,590 --> 00:04:57,540 Let's check the parameters hostname. 42 00:04:58,590 --> 00:05:06,630 The IP address, IP address is Bede's, all right, and we have the result, a result parameter, which 43 00:05:06,630 --> 00:05:08,420 is a test result. 44 00:05:08,430 --> 00:05:11,820 So if things are seems fine. 45 00:05:13,480 --> 00:05:19,900 So then what's the problem of the victims said common result. 46 00:05:20,950 --> 00:05:23,710 The column names Wollard. 47 00:05:25,970 --> 00:05:32,570 The table name victims is what it so seems like. 48 00:05:35,360 --> 00:05:44,060 The problem is the first question mark needs to be replaced with the result, but I made it hostname, 49 00:05:44,070 --> 00:05:45,890 so change it. 50 00:05:46,820 --> 00:05:50,600 And the second one will be the hostname and the third one will be the IP address. 51 00:05:53,660 --> 00:05:58,220 And try to use the car, request again, request again. 52 00:06:00,540 --> 00:06:01,500 And let's see. 53 00:06:04,050 --> 00:06:15,730 Now, as you can see, the test result has been inserted to database, so we have completed our task. 54 00:06:16,170 --> 00:06:17,350 That's it for this lecture. 55 00:06:17,370 --> 00:06:18,270 See you in the next one.