Serdar Nikola
Serdar Nikola

Reputation: 49

Give access to proper user agent

I want to give access to noted user agent, and to deny for rest user agents.

I have following script , but something is wrong here :

<?php

if( ($_GET['user_agent'],"DuneHD/1.0 (product_id: hdtv_101; firmware_version: 150721_0135_b9)")) {
 header('HTTP/1.0 200 OK');

}

else {

    header('HTTP/1.0 403 Forbidden');

}

?>

Upvotes: 0

Views: 57

Answers (1)

Itay Grudev
Itay Grudev

Reputation: 7454

Maybe what you are looking for is just:

if( $_GET['user_agent'] == "DuneHD/1.0 (product_id: hdtv_101; firmware_version: 150721_0135_b9)" ) {
  ...
}

There was en error in your if statement.

Upvotes: 2

Related Questions