Changeset 253 for trunk/admin/index.php


Ignore:
Timestamp:
Mar 12, 2018, 8:53:21 PM (7 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/index.php

    r23 r253  
    88/************************************************************************/
    99include("config.php");
    10                 $dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
    11                 mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
    12         mysql_query("SET NAMES 'utf8'", $dbi);
     10        try{
     11        $dbi = new PDO("mysql:host=$dbhost;charset=latin1", $dbuname, $dbpass, array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION));
     12        $sql = "use $dbname";
     13        $dbi->exec($sql);
     14        }
     15        catch(PDOException $e)
     16        {
     17            echo $sql . "<br>" . $e->getMessage();
     18        }                                                                                               
    1319//---10/05/2009  gestione consultazione predefinita
    1420//if (!isset($_SESSION['id_comune'])){
    15                 $res_config = mysql_query("select * from ".$prefix."_config ",$dbi);
    16                 list ($sitename,$siteurl,$site_logo,$slogan,$startdate,$adminmail,$tema,$foot,$language,$blocco,$testata,$logo,$fileout,$copyright,$versione,$patch,$id_comune) = mysql_fetch_row($res_config);
    17                 $siteistat=$id_comune;
     21        $sth = $dbi->prepare("select * from ".$prefix."_config");
     22        $sth->execute();
     23       
     24        $row = $sth->fetch(PDO::FETCH_ASSOC);
     25#               list ($sitename,$siteurl,$site_logo,$slogan,$startdate,$adminmail,$tema,$foot,$language,$blocco,$testata,$logo,$nometestata,$fileout,$copyright,$versione,$patch,$id_comune,$multicomune,$flash,$displayerrors,$gkey,$googlemaps,$editor,$tema_on,$ed_user) = ($res_config->fetch());
     26                $siteistat=$row['siteistat'];
    1827//}
    1928    Header("Location: admin.php?id_comune=$siteistat");
Note: See TracChangeset for help on using the changeset viewer.