Vi scrivo il form html che deve mandare i dati ad un file php "carlo.php". Non capisco come funziona la funzione trim...
Se compilo l'Email lasciando uno spazio tra nome e cognome nel file php rimane lo spazio anche se usata funzione trim.
L'ho messa nelle variabili del cognome, nome e mail.
Vi ringrazio molto dell'aiuto.
<html>
<head>
<title> primo script php </title>
</head>
<body>
<form action="carlo.php" method=post>
Nome <input type=text name="Nome" size=30>
Cognome <input type=text name="Cognome" size=30>
E-mail <input type=text name="Email" size=30>
Commenti <textarea name="Commenti" rows=6 cols=12></textarea>
<input type=submit name="Submit!" value=submit!>
<input type=reset name="Reset!" value=Reset!>
</form>
</Body>
</html>
"carlo.php"
<HTML>
<HEAD>
<TITLE>Form Results/Using Strings</TITLE>
</HEAD>
<BODY>
<?php
/* This page receives and handles the data generated by "form.html". */
$Nome = trim($Nome);
$Cognome = trim($Cognome);
$Email = trim($Email);
$Commenti = trim($Commenti);
print ("Your first name is $Nome.
\n");
print ("Your last name is $Nome.
\n");
print ("Your E-mail address is $Email.
\n");
print ("This is what you had to say:
\n $Commenti
\n");
?>
</BODY>
</HTML>