Skip to content

Commit

Permalink
lezione 3 - begin
Browse files Browse the repository at this point in the history
  • Loading branch information
martiele committed Apr 2, 2020
1 parent ee7b454 commit 6e51362
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lezione 2/1-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

<h3>Esempio di form</h3>

<p>ciao... edit by Daniele</p>
<p>by Rocco</p>
<form accept-charset="UTF-8" action="action_page.php" method="GET">



<form accept-charset="UTF-8" action="action_page.php" autocomplete="off" method="GET">
<fieldset>
<legend>Gruppo:</legend>
<label for="name">Nome</label>
Expand Down
14 changes: 14 additions & 0 deletions Lezione 2/action_page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$mionome = $_GET["name"];
/*
$messaggio = $_GET["messaggio"];
$sesso = $_GET["sesso"];
$interessi = $_GET["interessi"];
*/

?>

<h2>La risposta</h2>

Il tuo nome è: <?=$mionome?>
66 changes: 66 additions & 0 deletions Lezione 3/1-form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
if(isset($_GET["name"])){
var_dump($_GET);
foreach ($_GET as $key => $value) {
echo "<br />";
var_dump($value);
}
die();
}

?><!DOCTYPE html>
<html>
<head>
<title>Esempio di form</title>
<!-- link rel="stylesheet" type="text/css" href="mystyle.css" -->
</head>
<body>

<div class="content">
<h3>Esempio di form</h3>

<?php
$dest = $_SERVER['PHP_SELF'];
$method = "GET"; // Metodo GET oppure POST

/*
var_dump($dest);
die();
*/
?>

<form accept-charset="UTF-8" action="<?php echo $dest; ?>" autocomplete="off" method="<?=$method?>">
<fieldset>
<legend>Gruppo:</legend>
<label for="name">Nome</label>
<input name="name" type="text" value="" /> <br />
<br />
<label for="sex">Sesso</label>
<input checked="checked" name="sex" type="radio" value="male" /> Male
<input name="sex" type="radio" value="female" /> Female <br />
<br />
<textarea cols="30" rows="5" placeholder="Messaggio" name="messaggio"></textarea><br />
<br />
<label for="destinatario">Scrivi a:</label>
<select name="destinatario">
<option selected="selected" value="0">Generale</option>
<option value="1">Commerciale</option>
<option value="2">Tecnico</option>
</select><br />
<br />
<label for="interessi">Interessato a:</label> <br />
<input name="interessi[]" type="checkbox" value="sport" /> Sport<br />
<input name="interessi[]" type="checkbox" value="cinema" /> Cinema<br />
<input name="interessi[]" type="checkbox" value="musica" /> Musica<br />
<input name="interessi[]" type="checkbox" value="altro" /> Altro<br />
<br />
<button type="reset" value="Annulla">Annulla</button>
<button type="submit" value="Submit">Invia</button>
</fieldset>
</form>
</div>



</body>
</html>
34 changes: 34 additions & 0 deletions Lezione 3/2-invio-mail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
// definisco mittente e destinatario della mail
$nome_mittente = "Mio Nome";
$mail_mittente = "[email protected]";
$mail_destinatario = "[email protected]";

// definisco il subject ed il body della mail
$mail_oggetto = "Messaggio di prova";
$mail_corpo = "Questo è un messaggio di prova per testare la mia applicazione";

// aggiusto un po' le intestazioni della mail
// E' in questa sezione che deve essere definito il mittente (From)
// ed altri eventuali valori come Cc, Bcc, ReplyTo e X-Mailer
$mail_headers = "From: " . $nome_mittente . " <" . $mail_mittente . ">\r\n";
$mail_headers .= "Reply-To: " . $mail_mittente . "\r\n";
$mail_headers .= "X-Mailer: PHP/" . phpversion();

if (mail($mail_destinatario, $mail_oggetto, $mail_corpo, $mail_headers))
echo "Messaggio inviato con successo a " . $mail_destinatario;
else
echo "Errore. Nessun messaggio inviato.";

?><!DOCTYPE html>
<html>
<head>
<title>Invio mail</title>
</head>
<body>

<h3>Invio mail</h3>
<p>Invio mail test</p>

</body>
</html>
28 changes: 28 additions & 0 deletions Lezione 3/3-sessione.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>Esempio di form</title>
</head>
<body>

<h3>Esempio di form</h3>

<form accept-charset="UTF-8" action="action_page.php" autocomplete="off" method="GET">
<fieldset>
<legend>Login:</legend>
<br />
<label for="name">Username: </label>
<input name="name" type="text" value="" /> <br />
<br />
<label for="name">Password: </label>
<input name="name" type="text" value="" /> <br />
<br />
<label for="interessi">Ricordami:</label> <input name="ricordami" type="checkbox" value="1" /> <br />
<br />
<button type="submit" value="Submit">Accedi</button>
</fieldset>
</form>


</body>
</html>
1 change: 1 addition & 0 deletions Lezione 3/Sessioni.gslides
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"url": "https://docs.google.com/open?id=1M3s0xFVnufTa9AAu_ETlqobf9_ml97E0rrK4Riq435o", "doc_id": "1M3s0xFVnufTa9AAu_ETlqobf9_ml97E0rrK4Riq435o", "email": "[email protected]"}
85 changes: 85 additions & 0 deletions Lezione 3/mystyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

body{
font-size: 1em;
font-family: Helvetica;
background-color: #FEFEFE;
}

.content{
margin: 20px auto;
width: 90%;
max-width: 800px;
}

h3{
text-align: center;
color: red;
text-transform: uppercase;
font-size: 2em;
}

fieldset {
padding: 40px 30px;
border-radius: 15px;
box-shadow: 10px 10px 20px #666;
}

textarea{
width:99%;
}


/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/

button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}

/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/

button,
input { /* 1 */
overflow: visible;
}

/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/

button,
select { /* 1 */
text-transform: none;
}

/**
* Correct the inability to style clickable types in iOS and Safari.
*/

button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
background-color: #3256d8;
color: white;
padding: 6px 14px;
cursor: pointer;

}



0 comments on commit 6e51362

Please sign in to comment.