PHP Print Function Escape

68 Views Asked by At
<?php print('GET');

If I have the following WHERE GET is a GET parameter, is it possible to escape this for nefarious purposes i.e. can it be hacked?

Thanks

1

There are 1 best solutions below

1
On

Since you have 'GET' in quotes, it's a string literal. The fact that you have parameter $_GET['GET'] is not relevant -- when you print a literal, it just prints that string, it doesn't try to treat it as a variable, or the index in an array, or anything else.

So that print statement is perfectly safe.