php - How to validate HTTP_ACCEPT_LANGUAGE? -



php - How to validate HTTP_ACCEPT_LANGUAGE? -

since script gets $_server['http_accept_language'] visitor anything. how can validate it? acceptable?

to first language within string use:

substr($_server["http_accept_language"],0,2)

for example

$user_lang= split(",",$_server["http_accept_language"]); $language = $user_lang[0]; // header injection. if(stripos($language, 'content-type') !== false ) { exit; }

php

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -