Salve ho iniziato da poco a studiare il php. Volevo realizzare un semplice form in una pagina html che invia i dati (semplicemente un nome ed un cognome) ad un pagina php che a sua volta li processa inviandomeli tramite e-mail sfruttando la funzione mail(). Allora per fare questa prova ho creato 2 file. Uno index.html ed un altro send.php. Nel primo c'è il seguente codice:
codice:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Titolo</title>
</head>
<body>
<form action="send.php" method="POST">
<table border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td> Nome:</td>
<td align="right"><input type="text" text name="name"></td>
</tr>
<tr>
<td>Cognome:</td>
<td align="right"><input type="text" text name="surname"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="Submit" value="Invia"></td>
</tr>
</table>
</form>
</body>
</html>
Nell'altro invece
Codice PHP:
<?php
echo "
I dati sono stati inviati con successo</p>";
//start building the mail string
$msg= "Nome: $_POST[name] ";
$msg .= "Cognome: $_POST[surname] ";
//send the mail
mail("mia_mail", "Form", $msg);
?>
Dopo tramite l'ftp ho uppato i 2 file sullo spazio web di alice per vedere se funziona ma appena clicco su invia appare
Method Not Allowed
The requested method POST is not allowed for the URL xxxxx
Come mai?