Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/martiele/corsophp2020
Browse files Browse the repository at this point in the history
  • Loading branch information
martiele committed Apr 3, 2020
2 parents 06ccb90 + bcf4dda commit e3a7c56
Show file tree
Hide file tree
Showing 16 changed files with 318 additions and 1 deletion.
Empty file modified Lezione 3/PHPMailer/test/fakepopserver.sh
100755 → 100644
Empty file.
Empty file modified Lezione 3/PHPMailer/test/fakesendmail.sh
100755 → 100644
Empty file.
Empty file modified Lezione 3/PHPMailer/test/runfakepopserver.sh
100755 → 100644
Empty file.
43 changes: 43 additions & 0 deletions cappelli_edoardo/data_output.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
$prendi_sesso = $_GET["sesso"];
$prendi_messaggio = $_GET["messaggio"];
$prendi_destinatario = $_GET["destinatario"];
$interessi="Interessi selezionati: ";
foreach ($elenco_interessi as $valore){
$interessi .=$valore .",";
}
$interessi = substr($interessi, 0 , -1);

?>

Expand All @@ -16,4 +21,42 @@
Il messaggio inviato è: <?=$prendi_messaggio?>
<br>
Il destinatario è: <?=$prendi_destinatario?>
<br>
Gli interessi sono: <?=$interessi?>;



<?php
$nome_mittente = "Edoardo Cappell";
$mail_mittente = "[email protected]";
$mail_oggetto = "messaggio dal form del sito";
$mail_corpo ="";
$mail_corpo .="Nome: ". $prendi_nome . "<br />";
$mail_corpo .="Sesso: ". $prendi_sesso . "<br />";
$mail_corpo .="Messaggio: ". $prendi_messaggio . "<br />";
$mail_corpo .="Destinatario: ". $prendi_destinatario . "<br />";
$mail_corpo .="Interessi: ". $interessi . "<br />";

$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($prendi_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>


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

<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">
<fieldset>
<legend>Gruppo:</legend>
<label for="name">Nome</label>
<input name="nomepersona" 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>


</body>
</html>
14 changes: 14 additions & 0 deletions francesco_pietropaolo/action_page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

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

?>

<h2>La risposta</h2>

Il tuo nome è: <?=$mionome?>
45 changes: 45 additions & 0 deletions grosso rocco/Lezione 2/1-form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>Esempio di form</title>
</head>
<body>

<h3>Esempio di form</h3>

<p>ciao... edit by Daniele</p>
<p>by Rocco</p>

<form accept-charset="UTF-8" action="action_page.php" autocomplete="off" method="GET">
<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>


</body>
</html>
23 changes: 23 additions & 0 deletions grosso rocco/Lezione 2/action_page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

$prendi_nome= $_GET["name"];
$prendi_sex=$_GET["sex"];
$prendi_destinatario=$_GET["destinatario"];


?>
<!DOCTYPE html>
<html>
<head>
<title>Esempio di form</title>
</head>
<body>

<h2> La risposta </h2>

Il tuo nome è <?=$mionome?>
Il tuo sesso è <?=$miosex?>
Il tuo destinatario è <?=$miojob?>

</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 85 additions & 0 deletions marco_biagini/Styles/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;

}



2 changes: 1 addition & 1 deletion marco_biagini/1-form.php → marco_biagini/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<option value="1">Commerciale</option>
<option value="2">Tecnico</option>
</select>
<input type="hidden" name="dest_value" id="dest_hidden">
<input type="hidden" name="dest_value" id="dest_hidden" value="Generale">
<script>
Expand Down
34 changes: 34 additions & 0 deletions marco_biagini/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 marco_biagini/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>

0 comments on commit e3a7c56

Please sign in to comment.