if(file_exists($_SERVER['DOCUMENT_ROOT']."/hide_from_public")){
session_name("SGADMIN");
session_start();
if (isset($_SESSION['uid'])){
header('HTTP/1.0 404 Not Found');
die("not found");
}
}
session_start();
session_name("SITOSG");
if (isset($_REQUEST['setlang'])){
if($_REQUEST['setlang']=="it"){
$_SESSION['lang']='it';
header("Location: https://indie.studiogiochi.com/tabelloni");
}
if($_REQUEST['setlang']=="en"){
$_SESSION['lang']='en';
header("Location: https://indie.studiogiochi.com/tabelloni");
}
exit();
}
if( isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == "localhost"){
$webroot="";
include_once("admin/mysql.php");
} else {
$webroot="";
$root=$_SERVER['DOCUMENT_ROOT'];
include_once("admin/mysql.php");
}
header('Content-Type: text/html; charset=UTF-8');
if(!isset($_REQUEST['lang'])){
if(!isset($_SESSION['lang']))$_SESSION['lang']="it";
$lang=$_SESSION['lang'];
} else {
if($_REQUEST['lang']=="it")$lang='it';
if($_REQUEST['lang']=="en")$lang='en';
}
$id="";
if(isset($_REQUEST['id'])){
$id=(int)$_REQUEST['id'];
}
elseif(isset($_REQUEST['urlkey']) && isset($_REQUEST['urlcat'])){
$urlkey=$_REQUEST['urlkey'];
if(strstr($urlkey,"/") !== false){
$tmp=explode("/",$urlkey);
$subpage_key=$urlkey;
$urlkey=$tmp[0];
}
$wc="`url`= '".mysql_real_escape_string($urlkey)."'";
switch($_REQUEST['urlcat']){
case "autori":
$table="autori";
break;
case "editori":
$table="editori";
break;
case "giochi":
$table="giochi";
$wc.= " and `tipo`='gioco'";
break;
case "libri":
$table="giochi";
$wc.= " and `tipo`='libro'";
break;
case "pagine":
$table="pagine";
break;
case "puzzle":
$table="puzzle";
break;
case "gcg":
$table="gcg";
break;
case "gallery":
$table="fotogallery";
break;
}
$qry="select `id` from `$table` where $wc";
$res=mysqli_query($mysqli,$qry) or die("eoror 3939" .mysql_error());
$r=mysqli_fetch_array($res, MYSQLI_BOTH);
$id=$r[0];
// print $qry;
}
//print "
".$_SERVER['QUERY_STRING']."
$id";
include("common.php");
?>