cheap nfl jerseys china cheap nfl jerseys free shipping wholesale nfl jerseys china wholesale jerseys from china cheap nfl jerseys free shipping cheap nfl jerseys for sale cheap jerseys free shipping wholesale nfl jerseys from china cheap nfl jerseys sale cheap nike nfl jerseys china wholesale jerseys free shipping cheap nfl jerseys wholesale wholesale nfl jerseys online cheap nfl jerseys wholesale china jerseys wholesale cheap coach handbags outlet authentic designer handbags cheap coach handbags outlet cheap coach purses outlet discount coach bags coach bags sale coach purse outlet cheap real coach purses coach handbags sale online coach purse outlet michael kors outlet online store cheap michael kors bags cheap michael kors purse michael kors factory outlet online cheap michael kors handbags cheap michael kors purses michael kors bags outlet online cheap michael kors purse michael kors handbags discount cheap michael kors purse michael kors handbags discount
cheap nfl jerseys china cheap nfl jerseys free shipping wholesale nfl jerseys china wholesale jerseys from china cheap nfl jerseys free shipping cheap nfl jerseys for sale cheap jerseys free shipping wholesale nfl jerseys from china cheap nfl jerseys sale cheap nike nfl jerseys china wholesale jerseys free shipping cheap nfl jerseys wholesale wholesale nfl jerseys online cheap nfl jerseys wholesale china jerseys wholesale cheap coach handbags outlet authentic designer handbags cheap coach handbags outlet cheap coach purses outlet discount coach bags coach bags sale coach purse outlet cheap real coach purses coach handbags sale online coach purse outlet michael kors outlet online store cheap michael kors bags cheap michael kors purse michael kors factory outlet online cheap michael kors handbags cheap michael kors purses michael kors bags outlet online cheap michael kors purse michael kors handbags discount cheap michael kors purse michael kors handbags discount

Hello, $cName!"); } ?>

Il seguente esempio mostra le caratteristiche fondamentali di PHP (key features).
La prima volta raccoglie il nome con una form e lo memorizza in un cookie richiamando se stesso:

Scrivi il tuo nome:
<FORM ACTION="features.php" METHOD="POST"> Scrivi il tuo nome: <INPUT TYPE="text" NAME="inputName"> <INPUT TYPE="submit"></FORM>

Quando il cookie � settato, la pagina pu� accoglierti con un saluto.
I campi della form e i cookie vengono convertiti in variabili globali, che possono essere modificate normalmente, riducendo l'accozzaglia.
Prova a cambiare il nome!


Il primo blocco PHP verifica se la variabile inputName � settata: questa variabile pu� essere settata solo da una form o un cookie, quindi la prima volta sar� vuota, ma dopo il click PHP la crea.
Il cookie viene creato con la funzione setcookie(), che manda un header al browser e perci� deve stare prima di <HTML>. Viene anche creata una variabile con lo stesso nome del cookie.
<? if(isset($inputName))
{ setcookie("cName", $inputName, time()+86400);
$cName = $inputName; } ?>

Nelle visite successive, PHP crea la variabile, ma settare un cookie non � come ricevere un cookie dal browser.
Si noti che la veriabile non deve essere dichiarata; PHP indovina il tipo.

Il secondo blocco PHP controlla l'esistenza della variabile cName e, se inizializzata, la visualizza:
<? if(isset($cName)) { print("Hello, $cName!");} ?>