require '../../dashboard/classes/r1_data_class/race_data_class.php'; //function r1DataClass($db_host, $db_port, $db_engine, $db_username, $db_password, $db_app_database, $db_encoding){ $r1DataClassObject = new r1DataClass($conf_db_host, $conf_db_port, $conf_db_engine, $conf_db_username, $conf_db_password, $conf_db_app_database, $conf_db_encoding, $conf_app_debug); $raceDataClassObject = new raceDataClass($conf_db_host, $conf_db_port, $conf_db_engine, $conf_db_username, $conf_db_password, $conf_db_app_database, $conf_db_encoding, $conf_app_debug); //check db connection (fail/exit if no connection) $r1DataClassObject->CheckDbConnection(); $raceDataClassObject->CheckDbConnection(); //TEMP SOLUTION//////////////////////////////////////////////////////// //get session information (temoprary hard coded) //if user not logged in do not check user rights $rid = $_POST['ukryty']; if ($rid != 'prototyp') { //get user data (temoprary hard coded) $valid = 'OK'; $user_id = $_POST['user_id']; $query = $r1DataClassObject->GetTempFileData($user_id); if ($query["file"] != '') { $file = $query["file"]; $path = '../../filesystem/temp/' . $file; unlink($path); $delete = $r1DataClassObject->GetTempFileDelete($user_id); } $nazwa_baza = $_FILES['file']['name']; $typ = $_FILES['file']['type']; $c = explode(".", $nazwa_baza); $new_name = $c[0]; $d = explode('.', strrev($nazwa_baza)); $new_type = strrev($d[0]); // outputs "four" // $d = explode("/", $typ); // $new_type = $c[1];