$host = "localhost";
$user = "allariviera";
$password = "sp09_kwgf6";
$db = "allariviera";
$conn = mysql_pconnect($host, $user, $password);
if (! $conn)
//die("Impossibile connettersi a mysql.
host=$host
user=$user
password=$password");
die("Impossibile connettersi a mysql.");
mysql_select_db($db, $conn) or die("Impossibile aprire $db : ".mysql_error());
//per accentate
//mysql_set_charset('utf8',$conn); //qui non funziona
mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $conn);
//giro la data da gg/mm/aaaa a aaaa-mm-gg
function data_php2mysql($data) {
controlla_data_php($data);
$data_php2mysql = substr($data, 6, 4)."-".substr($data, 3, 2)."-".substr($data, 0, 2);
return $data_php2mysql;
}
//giro la data da aaaa-mm-gg a gg/mm/aaaa
function data_mysql2php($data) {
if (!empty($data)) {
$data_mysql2php = date("d/m/Y", strtotime($data));
} else {
$data_mysql2php = "";
}
return $data_mysql2php;
}
//giro la data da aaaa-mm-gg hh:mm:ss a gg/mm/aaaa hh:mm:ss
function dataora_mysql2php($data) {
if (!empty($data)) {
$data_mysql2php = date("d/m/Y H:i:s", strtotime($data));
} else {
$data_mysql2php = "";
}
return $data_mysql2php;
}
//controllo la validita' della data
function controlla_data_php($data) {
//controllo la validita' della data
//NB: http://it2.php.net/manual/it/function.ereg.php
$regexp_data_ddmmyyyy = "([0-9]{2})[-/]([0-9]{2})[-/]([0-9]{4})";
if ((!eregi($regexp_data_ddmmyyyy, $data)) or (!@checkdate(substr($data, 3, 2), substr($data, 0, 2), substr($data, 6, 4)))) {
include_once("../code/msg.inc.php");
header("Location: error.php?back=1&err_msg=".urlencode($msg_err_data["it"]));
exit;
}
}
?>
//per accentate
//mysql_set_charset('utf8',$conn);
//messo:
//mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $conn);
//in db.inc.php
function rsltGuestbook($lingua = "it", $limit) {
global $conn;
$qry = "SELECT * FROM guestbook";
$qry .= " WHERE 1";
$qry .= " AND enabled = 'si'";
//$qry .= " AND lingua = '$lingua'";
$qry .= " ORDER BY id DESC";
if (!empty($limit)) $qry .= " LIMIT 0, $limit";
$rslt = mysql_query($qry);
$rslt_array["rslt"] = $rslt;
return $rslt_array;
}
function rsltGuestbookId($id) {
global $conn;
$qry = "SELECT * FROM guestbook";
$qry .= " WHERE 1";
$qry .= " AND enabled = 'si'";
$qry .= " AND id = '$id'";
$rslt = mysql_query($qry);
$rslt_array["rslt"] = $rslt;
return $rslt_array;
}
function aggiungiRecord($lingua) {
global $conn;
$qry = "INSERT INTO guestbook SET";
$qry .= " nome = '".$_POST['nome']."'";
$qry .= ", citta = '".$_POST['citta']."'";
$qry .= ", nazione = '".$_POST['nazione']."'";
$qry .= ", voto = '".$_POST['voto']."'";
$qry .= ", periodo = '".$_POST['soggiorno']."'";
$qry .= ", giudizio = '".strtoupper($_POST['giudizio'])."'";
$qry .= ", commento = '".$_POST['messaggio']."'";
$qry .= ", lingua = '$lingua'";
$qry .= ", enabled = 'no'";
$rslt = mysql_query($qry);
return $rslt;
}
?>
Fatal error: Uncaught Error: Call to undefined function rsltGuestbook() in /usr/local/psa/home/vhosts/allariviera.it/httpdocs/nl/getuigenissen.php:10
Stack trace:
#0 {main}
thrown in /usr/local/psa/home/vhosts/allariviera.it/httpdocs/nl/getuigenissen.php on line 10