ho creato il seguente form in locale:
dopodiche ho realizzato lo script nominato "inserimento.php"
nel momento in cui compilo il form e avvio i dati ecco cosa compare:
Notice: Undefined index: cognome in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 33
Notice: Undefined index: nome in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 34
Notice: Undefined index: azienda in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 35
Notice: Undefined index: ruolo in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 36
Notice: Undefined index: telefono in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 37
Notice: Undefined index: cellulare in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 38
Attenzione,impossibile inserire il record
non capisco guardando il file php che errora possa aver fatto
HTML:
<html>
<head>
</head>
<body>
<table>
<form method="post" action="inserimento.php">
<tr><td> Cognome </td>
<td><input type="text" name="cognome" size="20" maxlength="20"></td></tr>
<tr><td> Nome </td>
<td><input type="text" name="nome" size="20" maxlength="20"></td></tr>
<tr><td> Azienda </td>
<td><input type="text" name="azienda" size="20" maxlength="20"></td></tr>
<tr><td> Ruolo </td>
<td><input type="text" name="ruolo" size="20" maxlength="20"></td></tr>
<tr><td> Email </td>
<td><input type="text" name="email" size="20" maxlength="20"></td></tr>
<tr><td> Telefono </td>
<td><input type="text" name="telefono" size="20" maxlength="20"></td></tr>
<tr><td> Cellulare </td>
<td><input type="text" name="cellulare" size="20" maxlength="20"></td></tr>
<tr><td colspan=\"2\"><input type="submit" value="Inserisci"></td></tr>
</form>
</table>
</body>
</html>
dopodiche ho realizzato lo script nominato "inserimento.php"
PHP:
<html>
<head>
</head>
<body>
<?php
$host='localhost';
$user='****';
$password='******';
$database='********';
$db=mysql_connect($host,$user,$password)
or die ("Impossibile connettersi al server $host");
mysql_select_db($database,$db)
or die ("Impossibile connettersi al database $database");
$query="insert into clienti_registrati".
"(cognome,nome,azienda,ruolo,email,telefono,cellualare)".
"VALUES('".
$_REQUEST['cognome'] . "','" .
$_REQUEST['nome'] . "','" .
$_REQUEST['azienda'] . "','" .
$_REQUEST['ruolo'] . "','" .
$_REQUEST['telefono'] . "','" .
$_REQUEST['cellulare'] . "')" ;
if (!mysql_query($query,$db))
{
print("Attenzione,impossibile inserire il record");
}
else
{
print("il record e' stato inserito");
}
?>
</body>
</html>
nel momento in cui compilo il form e avvio i dati ecco cosa compare:
Notice: Undefined index: cognome in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 33
Notice: Undefined index: nome in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 34
Notice: Undefined index: azienda in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 35
Notice: Undefined index: ruolo in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 36
Notice: Undefined index: telefono in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 37
Notice: Undefined index: cellulare in C:\Program Files (x86)\EasyPHP5.3.0\www\SITO\inserimento.php on line 38
Attenzione,impossibile inserire il record
non capisco guardando il file php che errora possa aver fatto