Jump to content

PHP web browser detection


dejvmeditrade

Recommended Posts

Hello, please could you help me with this PHP script? It should recognize users web browser and according it should input correct condition. 

I make this because SAFARI and IE don't support function ' type:''date'' '. So can you give me an advice? 

CODE:

<?php
       function detect()
        {
        if (\strpos($_SERVER['HTTP_USER_AGENT'], "MSIE", "Safari") === false){
           echo 'Dátum zákroku / Date of procedure [YYYY-MM-DD]';
           echo '<p><input class="w3-input w3-border" required name="datum_zakroku"></p>';
        }else{
            '<div class="w3-text-d1"><p><b>Dátum zákroku / Date of procedure</b></p></div>
            <p><input class="w3-input w3-border" type="date" required name="datum_zakroku"></p>';
        }
        }
       detect();
?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...