ciao a tutti,
ho un problema con il mi form html.
nella sostanza vorrei che nel campo data mi desse come valore di default la data odierna. ho provato varie soluzioni ma funzionato tutte con input type text ma non con date.
vi inserisco sotto il codice,
grazie mille
codice HTML:
<?phpinclude('session.php');
$matricola=$_POST['matricola'];
$connession = pg_connect("host=192.168.3.1 port=5432 dbname=LettureSantAnnaArresi user=StepGis password=StepGisManager") or die ('connection failed');
$query ="SELECT * FROM tracciati WHERE matricola='$matricola'";
$id_userfede2 = pg_query("$query") or die(pg_last_error()); // esegue la query
if(pg_num_rows($id_userfede2)) { // se la query ha restituito qualche riga (altrimenti il fetch darebbe errore)$row=pg_fetch_assoc($id_userfede2); // assegna la riga ad un array associativo}
$fk_matricola = $row['matricola'];$des_sog = $row['des_sog'];$cod_fis = $row['cod_fis'];$ind_con = $row['ind_con'];$civ_con = $row['civ_con'];$ult_let = $row['ult_let'];$data_ult_let = $row['data_ult_let'];
?>
<html> <head> <title>Comune di Sant'Anna Arresi - Letture contatori</title> <link rel="stylesheet" href="style.css" /><div id="profile"></div> </head>
<!-- Script Geolocalizzazione --><script type="text/javascript"> function getLocationConstant(){ if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(onGeoSuccess,onGeoError); } else { alert("Your browser or device doesn't support Geolocation"); }}
// If we have a successful location updatefunction onGeoSuccess(event){ document.getElementById("latitude").value = event.coords.latitude; document.getElementById("longitude").value = event.coords.longitude;
}
// If something has gone wrong with the geolocation requestfunction onGeoError(event){ alert("Error code " + event.code + ". " + event.message);} </script>
<!-- Script autocompletamento --> <script src="scriptaculous/prototype.js" type="text/javascript"></script><script src="scriptaculous/effects.js" type="text/javascript"></script><script src="scriptaculous/controls.js" type="text/javascript"></script>
<body>
<div class="container"> <div class="main"><h2><p class=MsoNormal><![if !vml]><img width=226 height=95src="rif/image002.png"v:shapes="Immagine_x0020_1"><![endif]></span></p><span style='font-size:20.0pt;mso-bidi-font-size:11.0pt;line-height:107%;font-family:"Berlin Sans FB Demi",sans-serif;color:#87aade'>Comune di Sant'Anna Arresi<br>Letture contatori</span><br></h2><hr/><div id="profile"><div id="profile"><b id="welcome">Letturista: <i><?php echo $nome; ?></i> </b><br /><input type="button" value="Logout" onclick="location.href='logout.php'"/><br /><!-- <b id="logout"><a href="logout.php">Abbandona</a></b> --><label >Torna al menù: </label><br /><input type="button" value="Indietro" onClick="location.href='cosa_fare.php'"/><br /><br /><span style='font-size:16.0pt;mso-bidi-font-size:11.0pt;line-height:107%;font-family:"Berlin Sans FB Demi",sans-serif;color:#003366'>Dati Utente</span><hr/><Label>Matricola contatore: <i><?php echo $fk_matricola; ?></i> </label><br /><br /><label>Utente: <i><?php echo $des_sog; ?></i> </label><br /><br /><label>Codice fiscale: <i><?php echo $cod_fis; ?></i> </label><br /><br /><label>Indirizzo: <i><?php echo $ind_con; ?></i> </label> <br /><br /><label>Numero civico: <i><?php echo $civ_con; ?></i> </label><br /><br /><label>Ultima lettura: <i><?php echo $ult_let; ?></i> </label><br /><br /><label>Data ultima lettura: <i><?php echo $data_ult_let; ?></i> </label><br /><br /><label>Cambia Utente: </label><br /><input type="button" value="Indietro" onClick="location.href='contatore.php'"/><br /><br /></div> <form name="insert" action="inserimento_riuscito.php" method="POST" enctype="multipart/form-data">
<input type="number" name="operatore" value="<?php echo $iduser; ?>" hidden /><input type="text" name="fk_matricola" value="<?php echo $fk_matricola; ?>" hidden /><span style='font-size:16.0pt;mso-bidi-font-size:11.0pt;line-height:107%;font-family:"Berlin Sans FB Demi",sans-serif;color:#003366'>Lettura: </span><hr/><label>Data di Compilazione: </label><br /> <input type="date" id="rit_data_let" name="rit_data_let" value="<?php echo date('d-m-Y') ?>" ><br /><br /><label>Tipo lettura/Stato Contatore: </label><br/> <input type="radio" name="id_stato" value="1" checked /> <label>Reale</label><input type="radio" name="id_stato" value="2"/> <label>Presunta</label><br/><input type="radio" name="id_stato" value="3"/> <label>Guasto</label><input type="radio" name="id_stato" value="4"/> <label>Illeggibile</label><br/><input type="radio" name="id_stato" value="5"/> <label>Bloccato</label><br/><br/> <label>Lettura: </label><br /> <input type="number" name="rit_lettura" value="" maxlength="8" placeholder="12345678" /> <br /><cfform action="gps2.cfm" method="post"><label>Latitudine: </label><input type="text" id="latitude" name="latitude" value=""><br /> <label>Longitudine: </label><input type="text" id="longitude" name="longitude" value=""><br /> <input type="button" value="Posiziona" onclick="getLocationConstant()"/><br /><br /><label>Select image to upload: </label><br /><input type="file" name="fileToUpload" id="fileToUpload"><br /><br /><label>Note: </label><br /> <input type="text" name="rit_note" value="" maxlength="250" /> <br /> <!--input type="reset" value="Reset" /--> <input type="submit" value="Carica" />
</form> </div>
</div> </body></html>