Jump to content

How to redirect if the $_GET['ENTERACTIONHERE']; dosent exist


codrgi

Recommended Posts

You could make an array of $_GETs that are allowed and then check if each $_GET is in there.  Like so:

 

$allow_get = array('something', 'something_else');

foreach($_GET as $key => $val) {
    if(!in_array($key, $allow_get)) {
        header("Location: http://somewhere.com/somepage.php");
        exit;
    }
}

 

 

But I have to wonder why you care if someone makes up a $_GET.  Does it pose a security threat to your application?  It shouldn't x.x.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.