f7af9ddfa9
Files correlati : Ricompilazione Demo : [ ] Commento : Prime modifiche git-svn-id: svn://10.65.10.50/trunk@9788 c028cbd2-c16b-5b4b-a496-9718f37d4682
64 lines
1.6 KiB
PHP
Executable File
64 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
include("required.php");
|
|
include("funzioni.php");
|
|
|
|
$db = mysql_connect($ip, $user, $password);
|
|
mysql_select_db($dataname,$db);
|
|
|
|
if (isset($nome))
|
|
{
|
|
$sql = "INSERT INTO $tbl_lezioni (idcorso, nome, progressivo, percorso) VALUES ("
|
|
.$idcorso.",'"
|
|
.$nome."',"
|
|
.$progressivo.",'"
|
|
.$immagine."')";
|
|
//echo $sql;
|
|
$ins = mysql_query($sql,$db);
|
|
if ($ins)
|
|
header ("location: tuttitest.php");
|
|
//else
|
|
//echo "<br><br><p class=error>Inserimento non effetttuato!</p><br><br>";
|
|
}
|
|
else
|
|
{
|
|
?>
|
|
|
|
<html>
|
|
<head>
|
|
<title>Test</title>
|
|
<LINK rel="stylesheet" type="text/css" href="stile.css">
|
|
<META HTTP-EQUIV="Expires" CONTENT="3">
|
|
</head>
|
|
|
|
<script language=javascript>
|
|
function verifica()
|
|
{
|
|
esito = true;
|
|
if (document.form1.nome.value == "") esito = false;
|
|
if (document.form1.progressivo.value == "") esito = false;
|
|
if (esito == false) alert('Dati inseriti non completi!');
|
|
if (esito == true) document.form1.submit();
|
|
return false;
|
|
}
|
|
</script>
|
|
|
|
<body>
|
|
|
|
<?php
|
|
|
|
echo "<form name=form1 action=n_lezione.php><table align=center>";
|
|
echo "<tr><td><input type=text size=2 name=idcorso value=$idcorso></td></tr>";
|
|
echo "<tr><td>Nome della lezione</td><td><input type=text name=nome value=$nome></td></tr>";
|
|
echo "<tr><td>Progressivo</td><td><input type=text name=progressivo value=$progressivo></td></tr>";
|
|
echo "<tr><td>Immagine</td><td><input type=file name=percorso></td></tr>";
|
|
|
|
echo "<tr><td> </td><td><input type=button class=bottoni value=Salva onclick='return verifica();'></td></tr>";
|
|
|
|
echo "</table></form>";
|
|
|
|
|
|
echo "</body></html>";
|
|
|
|
}
|