From d78584dcf694042aea0be8c5733e3273002689ca Mon Sep 17 00:00:00 2001 From: Raghav <raghavsmart1213@gmail.com> Date: Thu, 27 Feb 2025 07:48:47 +0000 Subject: [PATCH] Head tag separated to head.php --- _templates/head.php | 22 +++++++++++++++++++++ _templates/header.php | 5 ++++- _templates/login-content.php | 1 + index.php | 32 ++++++------------------------ login.php | 38 ++++++++---------------------------- 5 files changed, 41 insertions(+), 57 deletions(-) create mode 100644 _templates/head.php diff --git a/_templates/head.php b/_templates/head.php new file mode 100644 index 0000000..82c842d --- /dev/null +++ b/_templates/head.php @@ -0,0 +1,22 @@ +<head> + <script src="/photogram-project-php/assets/js/color-modes.js"></script> + + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="description" content=""> + <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"> + <meta name="generator" content="Hugo 0.122.0"> + <title>Album example · Bootstrap v5.3</title> + + <link rel="canonical" href="https://getbootstrap.com/docs/5.3/examples/album/"> + + + + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"> + + <link href="/photogram-project-php/assets/dist/css/bootstrap.min.css" rel="stylesheet"> + + <!-- Style for login forms --> + <link href="/photogram-project-php/assets/dist/css/login-in.css" rel="stylesheet"> + +</head> \ No newline at end of file diff --git a/_templates/header.php b/_templates/header.php index eb81b9d..8430657 100644 --- a/_templates/header.php +++ b/_templates/header.php @@ -1,3 +1,4 @@ +<header data-bs-theme="dark"> <!-- Header content --> <div class="collapse text-bg-dark" id="navbarHeader"> <div class="container"> @@ -17,6 +18,7 @@ </div> </div> </div> + <!-- Header Bar --> <div class="navbar navbar-dark bg-dark shadow-sm"> <div class="container"> @@ -28,4 +30,5 @@ <span class="navbar-toggler-icon"></span> </button> </div> - </div> \ No newline at end of file + </div> +</header> \ No newline at end of file diff --git a/_templates/login-content.php b/_templates/login-content.php index 408b99c..c2e2de8 100644 --- a/_templates/login-content.php +++ b/_templates/login-content.php @@ -3,6 +3,7 @@ $username = $_POST['email']; $password = $_POST['password']; $validate = validate_credentials($username, $password); + if($validate){?> <!-- If it is true is display true page --> <main class="container"> diff --git a/index.php b/index.php index f4d92b6..1bad306 100644 --- a/index.php +++ b/index.php @@ -5,24 +5,11 @@ include 'libs/load.php'; <!doctype html> <html lang="en" data-bs-theme="auto"> - <head><script src="/photogram-project-php/assets/js/color-modes.js"></script> - - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content=""> - <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"> - <meta name="generator" content="Hugo 0.122.0"> - <title>Album example · Bootstrap v5.3</title> - - <link rel="canonical" href="https://getbootstrap.com/docs/5.3/examples/album/"> - - - - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"> - -<link href="/photogram-project-php/assets/dist/css/bootstrap.min.css" rel="stylesheet"> - - <style> + <!-- To load head --> + <?load_template('head')?> +<body> + <!-- Style for toggle button --> + <style> .bd-placeholder-img { font-size: 1.125rem; text-anchor: middle; @@ -99,11 +86,7 @@ include 'libs/load.php'; .bd-mode-toggle .dropdown-menu .active .bi { display: block !important; } - </style> - - - </head> - <body> + </style> <!-- To change dark to light mode --> <svg xmlns="http://www.w3.org/2000/svg" class="d-none"> <symbol id="check2" viewBox="0 0 16 16"> @@ -156,12 +139,9 @@ include 'libs/load.php'; </ul> </div> - -<header data-bs-theme="dark"> <!--To load header file from template --> <?load_template('header')?> -</header> <main> diff --git a/login.php b/login.php index 4ef60ed..2f5532c 100644 --- a/login.php +++ b/login.php @@ -5,28 +5,11 @@ include 'libs/load.php'; <!doctype html> <html lang="en" data-bs-theme="auto"> - <head><script src="/photogram-project-php/assets/js/color-modes.js"></script> - - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content=""> - <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"> - <meta name="generator" content="Hugo 0.122.0"> - <title>Login Page</title> - - <link rel="canonical" href="https://getbootstrap.com/docs/5.3/examples/album/"> - - - - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"> - -<link href="/photogram-project-php/assets/dist/css/bootstrap.min.css" rel="stylesheet"> - -<!-- Style for login forms --> - <link href="/photogram-project-php/assets/dist/css/login-in.css" rel="stylesheet"> - - - <style> + <!-- To load head --> + <?load_template('head')?> +<body> + <!-- Style for toggle button --> + <style> .bd-placeholder-img { font-size: 1.125rem; text-anchor: middle; @@ -103,11 +86,7 @@ include 'libs/load.php'; .bd-mode-toggle .dropdown-menu .active .bi { display: block !important; } - </style> - - - </head> - <body> + </style> <!-- To change dark to light mode --> <svg xmlns="http://www.w3.org/2000/svg" class="d-none"> <symbol id="check2" viewBox="0 0 16 16"> @@ -161,11 +140,10 @@ include 'libs/load.php'; </div> -<header data-bs-theme="dark"> - + + <!--To load header file from template --> <?load_template('header')?> -</header> -- GitLab