Changeset 360 for trunk/client/file.php
- Timestamp:
- Mar 14, 2022, 5:13:56 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/file.php
r265 r360 3 3 include("config.php"); 4 4 try{ 5 $dbi = new PDO("mysql:host=$dbhost;charset= latin1", $dbuname, $dbpass, array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION));5 $dbi = new PDO("mysql:host=$dbhost;charset=utf8", $dbuname, $dbpass, array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 6 6 $sql = "use $dbname"; 7 7 $dbi->exec($sql); … … 11 11 echo $sql . "<br>" . $e->getMessage(); 12 12 } 13 $sth = $dbi->prepare("SET NAMES 'utf8'"); 14 $sth->execute(); 15 16 13 17 $fase=intval($_GET['fase']); 14 18 … … 19 23 $res->execute(); 20 24 21 Header("content-type: application/x-javascript ");25 Header("content-type: application/x-javascript; charset=utf-8"); 22 26 echo "document.write(\"<b><select name=\'id_cons_gen2\'>"; 23 27 24 28 while(list($id_cons_gen2,$descr) = $res->fetch(PDO::FETCH_NUM)) { 25 echo "<option value=\'$id_cons_gen2\'>$descr ";29 echo "<option value=\'$id_cons_gen2\'>$descr</option>"; 26 30 } 27 31 echo "</select>"; … … 44 48 $res->execute(); 45 49 46 Header("content-type: application/x-javascript ");50 Header("content-type: application/x-javascript; charset=utf-8"); 47 51 echo "document.write(\"<b><input type=\'hidden\' name=\'id_cons_gen2\' value=\'$id_cons_gen2\'><select name=\'id_comune2\'>"; 48 52 49 53 while(list($id_comune2,$descr) = $res->fetch(PDO::FETCH_NUM)) { 50 echo "<option value=\'$id_comune2\'>$descr ";54 echo "<option value=\'$id_comune2\'>$descr</option>"; 51 55 } 52 56 echo "</select>";
Note:
See TracChangeset
for help on using the changeset viewer.