Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
- <link href="bdlab.css" rel="stylesheet" type="text/css"/>
- <title>Utilizzo della variabile $_GET</title>
- </head>
- <body>
- <h2>Utilizzo della variabile $_GET</h2>
- <pre>
- <?php
- //print_r($_GET);
- $ricette_puglia=Array(
- "Cartellate pugliesi ricetta",
- "Panzerotti fritti pugliesi",
- "Vincotto di fichi secchi",
- "Zucchine ripiene di tonno");
- $ricette_liguria=Array(
- "Torta di carciofi",
- "Salsa verde",
- "Focaccia genovese");
- $ricette=Array();
- $ricette["Puglia"]=$ricette_puglia;
- $ricette["Liguria"]=$ricette_liguria;
- ?>
- </pre>
- <div>
- Ricette originali della regione
- <?php
- print($_GET["regione"]);
- ?>
- </div>
- <?php
- $ricette_param=$_GET["regione"];
- $ricetta_list=$ricette[$ricette_param];
- //Posso sostituire le 2 righe sopra con la seguente:
- //$ricetta_list=$ricette[$_GET["regione"]];
- foreach($ricetta_list as $ricetta){
- print("<div>");
- print($ricetta);
- print("</div>");
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement