<?php 

	$pid	= $_GET['pid'];
	$xuid	= $_GET['xuid'];
	$lang 	= $_GET['lang'];	
	$mid	= $_GET['mid'];
	$xfdc 	= $_GET['xfdc'];
	
	// CHECK FOR FORMS NOT HAVING xfdc on url
	$nfid = 1;

	if ($pid == '') {
		$pid	= $_POST['pid'];
		$xuid	= $_POST['xuid'];
		$lang 	= $_POST['lang'];			
		$mid	= $_POST['mid'];				
	}

	if ($data_db == '') { 
		include('config.php');
		include('field_names.php'); 
		include('users.php');	
	}		

include_once('nf_database.php');
include_once('nf_paginator.class.php');
define('SS_DB_NAME', $data_db);
define('SS_DB_USER', $data_user);
define('SS_DB_PASSWORD', $data_pswd);
define('SS_DB_HOST', $data_server);

$dsn	= 	"mysql:dbname=".SS_DB_NAME.";host=".SS_DB_HOST."";
$pdo	=	"";
try {
	$pdo = new PDO($dsn, SS_DB_USER, SS_DB_PASSWORD);
}catch (PDOException $e) {
	echo "Connection failed: " . $e->getMessage();
}
$db 	=	new Database($pdo);
$pages 	=   new Paginator();

// Change character set to utf8
$pdo->query("SET NAMES 'utf8'");

?>