The Student Room Group

iDEA Silver Badge Citizen Resolution

I am stuck on how to sanitise the code: $message. I tried doing...
$message = escape_tags($message) but it won't work. If you know the answer please comment below. Thanks.

Scroll to see replies

have u got the answer yet
i need the answer
Reply 3
Hey try this $message = escape_tags($message);insertIntoDatabase($message) $
Original post by Hk479
Hey try this $message = escape_tags($message);insertIntoDatabase($message) $

It is telling me to think about the order which you call the functions.
Reply 5
Original post by jAkE GiNgEr
have u got the answer yet

Hi all you have to do is write it in the right place (which is the middle of the first two sentences)
I don't understand?
Original post by Nicoliam
Hi all you have to do is write it in the right place (which is the middle of the first two sentences)

i dont understand, how to resolve this issue
I know this may be a bit late but, if you have just the original two lines you simply but the code above into the middle of the two lines it should work.

$message = $_POST['message']; $message = escape_tags($message);insertInto Database($message) $insertIntoDatabase($message);


This is what it looks like.
(edited 4 years ago)
that dosent work
Original post by Dylanlieb_
I know this may be a bit late but, if you have just the original two lines you simply but the code above into the middle of the two lines it should work.

$message = $_POST['message']; $message = escape_tags($message);insertInto Database($message) $insertIntoDatabase($message);


This is what it looks like.

it dosent work
Original post by dddddrrrrrrr
it dosent work

It worked for me, sorry
Can anyone help me in the myFormData part really struggling
Capture S.PNG I need urgent help someone pls help me I have attached the document
Reply 14
Does anyone know how to do the Fred’s deli part
The answer to sanitise the variable before it gets inserted into the database
should be:

$myFormData = escape_tags($myFormData);
insertIntoDatabase($myFormData)

Hope this helps!
(edited 4 years ago)
Yea this helps a lot thx first try
Original post by Raihan A
Capture S.PNG I need urgent help someone pls help me I have attached the document

This is the solution:

P.S. I have posted two screenshots because they are both correct but you only forgot to use the restart code (block) as you should drag it or place it next to the incorrect code (block).
(edited 4 years ago)
$message = $_POST['message'];$message = escape_tags($message);insertIntoDatabase($message);It worked for me
Original post by Pop-corn
Does anyone know how to do the Fred’s deli part


This is the solution:

Screenshot_2020-07-30 iDEA - The Digital Citizen Part Three.png
Hope this helps!
P.S. I have also uploaded an attachment if you can't see it.

Quick Reply