The Student Room Group

iDEA Silver Citizen Badge 2

Scroll to see replies

the first line should be $myFormData=escape_tags(myFormData);
(edited 3 years ago)
Original post by tinyminy13
the first line should be $myFormData=escape_tags($myFormData);

that didnt work pls show screenshots to prove it
There shouldn't be a space, this keeps making errors when i finish typing.
How do you sanatise the variable in this code?

$message = $_POST['message'];

insertIntoDatabase($message);
Original post by Help__please
How do you sanatise the variable in this code?

$message = $_POST['message'];

insertIntoDatabase($message);

The answer to sanitise the variable before it gets inserted into the database
should be:

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

You only need to replace the first line with the escape_tags variable and replace $message to $myFormData.
Hope this helps!
(edited 3 years ago)
Hi does anyone know the way to get past the My Form bit, the bit about the My variables. Thanks in advance.
Do you know that I have just posted it above!
Original post by tinyminy13
Do you know that I have just posted it above!

no I didn't thanks
Reply 48
It doesn't work for me.
$myFormData = escape_tags($myFormData);
i need the answer for this too! :/
i said how do you do this one
Original post by Jammyjam10
Yes I’ve just done it -Type

$review = $_POST['review'];

$review = escape_tags($review);


Are you sure 😂
how do u sanitise this :
$review = $_POST['review'];
insertIntoDatabase($review);
Original post by luna wolf 12
how do u sanitise this :
$review = $_POST['review'];
insertIntoDatabase($review);

The answer to sanitise it should be:

$review = escape_tags($review);
insertIntoDatabase($review)

You only need to replace the first line with the escape_tags variable and replace $message to $review.
Hope this helps!
That helped me, Thanks
thank you very much
im stuck in the my form
Original post by Faria_Shahid
im stuck in the my form

The answer to sanitise the variable before it gets inserted into the database should be:

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

You only need to replace the first line with the escape_tags variable and replace $message to $myFormData.
Hope this helps!
Original post by ThatOneWoomy
i said how do you do this one

i also need help to this one

Quick Reply

Latest

Trending

Trending