• Resolved moones

    (@moones)


    Hello,

    I have the following code in my WP:

    <?php $bg = $_GET['q']; if ($bg == black) {?> output <?php } else {} ?>

    So, if I put in URL somesite.com?q=black, then I will get the output. It works.

    My question is about potential security issues with this method. Is it safe or should I filter or sanitize the variables and how do I do so.

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter moones

    (@moones)

    Here it is:

    <?php if(isset($_GET['q']) && $_GET['q'] == black) {?> do something <?php }?>
Viewing 1 replies (of 1 total)

The topic ‘Secure $_GET’ is closed to new replies.