-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/martiele/corsophp2020
- Loading branch information
Showing
16 changed files
with
318 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
||
?> | ||
|
||
|
@@ -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> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |