erlug
[Top] [All Lists]

Re: [Erlug] Mi manca una struttura di controllo del php?

To: erlug@xxxxxxxxxxxxxx
Subject: Re: [Erlug] Mi manca una struttura di controllo del php?
From: Pierpaolo <ciops@xxxxxx>
Date: Fri, 21 Jun 2002 16:36:34 +0200
Francesco Gigli wrote:

Prima il sorgente..
---------------8<-html-&-php-------------------------

    <html>
     <title>
      Spaghetti :o)
     </title>
    <body>
<? echo "Stai usando $HTTP_USER_AGENT. <br>"; if ($HTTP_USER_AGENT == "Windows") {
        echo "..Qui non sei benvenuto..";
       }
else {
        echo "Benvenuto!";
       }
?>
    </body>
    </html>
---------------8<-html-&-php-------------------------

Il problema e' qui: $HTTP_USER_AGENT == "Windows"
che il controllo che desideravo usare non e' "==" ovvero "e' identico a"
ma un qualcosa di tipo "contiene anche" .. Esiste? Nel caso qual'e'?

     <?echo "Grazie infinite!!" ?>

Francesco, che sta imparando il <php>..



da www.php.net:

strstr

(PHP 3, PHP 4 )
strstr -- Find first occurrence of a string

http://www.php.net/manual/en/function.strstr.php


cmq se non ricordo male esiste un modo migliore per esser sicuri dell'OS ma non me lo ricordo........

--
Qualcuno ha visto il mio correttoredibozzepazzo? E' scappato!
--
Pierpaolo Ciuoffo - ciuoffo@xxxxxxxx - ciops@xxxxxx




<Prev in Thread] Current Thread [Next in Thread>