From 24f62ca4c291ab8fed6a6b2d01c368f4b9422e3e Mon Sep 17 00:00:00 2001 From: Rafael Minaya Date: Mon, 5 Jan 2026 17:19:24 -0400 Subject: [PATCH] Add initial .htaccess and PHP files for project setup --- .htaccess | 8 +++++++ index.php | 20 +++++++++++++++++ init.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 .htaccess create mode 100644 index.php create mode 100644 init.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..9c1ffca --- /dev/null +++ b/.htaccess @@ -0,0 +1,8 @@ +RewriteEngine on +RewriteCond %{HTTPS} !=on [NC] +RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] + +Options All -Indexes + +ErrorDocument 403 https://%{SERVER_NAME}/?view=403 +ErrorDocument 404 https://%{SERVER_NAME}/?view=404 \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..ce33d42 --- /dev/null +++ b/index.php @@ -0,0 +1,20 @@ +setTitle('RDMusicWorld'); +$html->setIconPage($assets['IMAGE']['FILE_DIR']['music']); +$html->loadStyles($styles); +$html->loadScripts($scripts); + +ob_start(); +if(!empty($_POST)){ + include $page['REQUEST']['POST']['FILE_DIR'][$view]; +}else{ + include $views[$view]; +} +$view_page = ob_get_clean(); + +$html->loadHTML($view_page, $view); + +$html->output(); \ No newline at end of file diff --git a/init.php b/init.php new file mode 100644 index 0000000..7925047 --- /dev/null +++ b/init.php @@ -0,0 +1,65 @@ +getGennersMusical(); +$musics = $music->getMusics((isset($_GET['search']) ? $_GET['search'] : null)); +$listsName = $listplayer->getListName(); + +if(isset($_GET['listmusic'])){ + if(!empty($_GET['listmusic'])){ + $listMusics = $listplayer->getListMusic($_GET['listmusic']); + if(empty($listMusics)){ + header("location: ./?view=$view"); + } + }else{ + header("location: ./?view=$view"); + } +} + +$elementDelete = getElementsDelete([ + $listplayer->getDelete(), + $music->getDelete() +]); \ No newline at end of file