I have an "uploads" folder that according to the database with php and mysql shows some videos, the problem is that in localhost it works, but when I insert the files in the file manager of the host (000webhost), the host cannot recognize the path "uploads", this is full code, the problem is in the video src at the end of the code.
<?php
require_once("config.php");
$result=' ';
$cerca=$_POST["cerca"];
$sql = "SELECT * FROM artisti WHERE nome like '%".$cerca."%'";
$result = $conn->query($sql);
if ($result->num_rows > 0)
{
//echo "<h1>Artisti trovato</h1>";
while ($row = $result->fetch_assoc()) {
$ID=$row["ID"];
$nome=$row["nome"];
$link=$row["link"];
$album=$row["album"];
//echo "<h2>ID: "."$ID"."</h2>";
//echo "nome: "."$nome"."<br>";
}
}
else {
echo "nessun artista trovato";
$conn->close();
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Utopia-Playlist</title>
<!--Reset css per ogni broswer-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" integrity="sha512-NmLkDIU1C/C88wi324HBc+S2kLhi08PN5GDeUVVVC/BVt/9Izdsc9SVeVfA1UZbY3sHUlDSyRXhCzHfr6hmPPw==" crossorigin="anonymous" />
<!--Script scroll-->
<script src="https://unpkg.com/scrollreveal#4.0.0/dist/scrollreveal.min.js"></script>
<!--Icone-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<!--Icona tab di google-->
<link rel="icon" href="Fulmine viola bianco.png">
<link rel="stylesheet" href="hero.css">
<link rel="stylesheet" href="nav.css">
<link rel="stylesheet" href="playlist1.css">
<style>
#import url('https://fonts.googleapis.com/css2?family=Overpass&display=swap');
</style>
</head>
<body>
<!--NavBar-->
<header class="he">
<h1 class="developers">Utopia Playlist</h1>
<nav>
<div class="listanav">
<li class="icon">Home</li>
<li>Playlist <i class="fas fa-caret-down"></i>
<ul class="submenu">
<li>Consigli</li>
<li>
Consigli-DV
</li>
<li> Top 50</li>
</ul>
</li>
<li>Contattaci</li>
</div>
</div>
</nav>
<button type="button" class="accedi">Accedi</button>
</header>
<!--Hero--> <!-- class="btn" -->
<div class="hero">
<div class="hero-cn scroll">
<p class="intro-text">ASCOLTA I NOSTRI CONSIGLI!</p>
<?php echo "<h1 class=grande-text>"."$nome"."</h1>"?>
<?php echo "<a class=btn href=$album>Scopri di più</a>" ?>
</div>
<video autoplay muted loop class="vd">
<source src="uploads/<?php echo $link?>" type="video/mp4" >
</video>
</div>
maybe there are some that you should check again:
The $link variable hasn't gotten the value it got
Placement of folders is not the same right
Check the connection whether it is connected to the hosting database or not
Related
I have my index.php in which I am including the header. But the problem is that I want a different header title as I am including it in other pages well. I want it to change dynamically according to page like if its other page like shop then title should be Toys - Shop like this. I am new to PHP can anyone please help me with how to do it? Index.php:
<?php include'headernav.php';?>
<div class="header-outs" id="home">
<div class="header-bar">
<div class="info-top-grid">
<div class="info-contact-agile">
<ul>
<li>
<span class="fas fa-phone-volume"></span>
<p>+(000)123 4565 32</p>
</li>
<li>
<span class="fas fa-envelope"></span>
<p>info#example1.com</p>
</li>
<li>
</li>
</ul>
</div>
</div>
</div>
</div>
Headernav.php:
<!DOCTYPE html>
<html lang="zxx">
<head>
<title>Toys-Home</title>
<!--meta tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="" />
<link href="css/style.css" rel='stylesheet' type='text/css' media="all">
<!--//stylesheets-->
<link href="//fonts.googleapis.com/css?family=Sunflower:500,700" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
</head>
<body>
You can do something like this:
index.php:
<?php
$pagename = 'Toys-Home';
include ('headernav.php');?>
<div class="header-outs" id="home">
<div class="header-bar">
<div class="info-top-grid">
<div class="info-contact-agile">
<ul>
<li>
<span class="fas fa-phone-volume"></span>
<p>+(000)123 4565 32</p>
</li>
<li>
<span class="fas fa-envelope"></span>
<p>info#example1.com</p>
</li>
<li>
</li>
</ul>
</div>
</div>
</div>
</div>
headernav.php
<!DOCTYPE html>
<html lang="zxx">
<head>
<title><?php print $pagename; ?></title>
<!--meta tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="" />
<link href="css/style.css" rel='stylesheet' type='text/css' media="all">
<!--//stylesheets-->
<link href="//fonts.googleapis.com/css?family=Sunflower:500,700" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
</head>
<body>
You'd have to set the $pagename variable on each page if that's something you're looking for. Each page would have the title you've set in that variable.
#Loupeznik's accepted answer provides a solution. An alternative is to use functions in include files and call them from the main PHP. You will have to write a bit more code, but you will get more flexibility. E.g. you will be able to add different css or js files on different pages letter or use a single include file for both header and footer or other common PHP code.
The way to do this is to add a function called writeHeaderNav() or something similar and then call it from index.php with $pagename as an argument.
headernav.php
<?php
function writeHeaderNav($pagetitle){
echo"<!DOCTYPE html>
<html lang='zxx'>
<head>
<title>$pagetitle</title>
<!--meta tags -->
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name='keywords' content='' />
<link href='css/style.css' rel='stylesheet' type='text/css' media='all'>
<!--//stylesheets-->
<link href='//fonts.googleapis.com/css?family=Sunflower:500,700' rel='stylesheet'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet'>
</head>
<body>";
}
//you can have other PHP code here if needed
function writeFooter(){
//echo html for common footer
}
?>
index.php
<?php
$pagename = 'Toys-Home';
include ('headernav.php');
writeHeaderNav($pagename);
// or you can use writeHeaderNav('Toys-Home');
?>
<div class="header-outs" id="home">
<!--rest of code-->
You can put a variable like this in your Headernav.php file and have it defined before your include
< title> < ?php echo "$my_title"; ?>
This variable can be changed by the way you get it
from your url ($_GET)
from a sql query
from a session variable
...
when i logging in with user and pass session id not activate in site in wamp worked but when i uploaded to 000webhost not working i wnat solution for my problem and this my code
index.php
<?php
session_start();
include 'connection.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tekkadan</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Baloo">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
body {
font-family: 'Baloo', cursive !important;
}
h3{
font-family: 'Baloo', cursive !important;
}
b{
font-family: 'Baloo', cursive !important;
}
.mySlides {display: none}
</style>
</head>
<body>
<!-- Navbar -->
<div class="w3-top">
<div class="w3-bar w3-black w3-card">
<a class="w3-bar-item w3-button w3-padding-large w3-hide-medium w3-hide-large w3-right" href="javascript:void(0)" onclick="myFunction()" title="Toggle Navigation Menu" ><img src="sidr.png" style="height: 30px;width: 30px;background-color: #841818;"></i></a>
HOME
<?php if(empty($_SESSION['sess_guild'])){?>
تسجيل دخول
<?php }else{?>
الجيني
البروفايل
تسجيل خروج
<?php } ?>
<?php if(!empty($_SESSION['sess_auth'])){
if ($_SESSION['sess_auth']=="admin" || $_SESSION['sess_auth']=="co" || $_SESSION['sess_auth']=="giny" || $_SESSION['sess_auth']=="warning") {?>
الادمن
<?php }} ?>
</div>
</div>
<!-- Navbar on small screens (remove the onclick attribute if you want the navbar to always show on top of the content when clicking on the links) -->
<div id="navDemo" class="w3-bar-block w3-black w3-hide w3-hide-large w3-hide-medium w3-top" style="margin-top:46px">
HOME
<?php if(empty($_SESSION['sess_guild'])){?>
تسجيل دخول
<?php }else{?>
الجيني
الادمن
تسجيل خروج
البروفايل
<?php } ?>
</div>
and proccess of login.php
<?php
include 'connection.php';
session_start();
if(empty($_SESSION['sess_guild'])){
$user=$_POST['user'];
$pass=$_POST['pass'];
$sql = mysqli_query($conn,"SELECT * FROM users WHERE user ='".$user."' AND pass='".$pass."' ");
$row = mysqli_fetch_assoc($sql);
$numrows = mysqli_num_rows($sql);
if ($numrows == 0) {
echo "invaild pass or user";
}else{
$_SESSION['sess_user']=$row[user];
$_SESSION['sess_guild']=$row[guild];
$_SESSION['sess_auth']=$row[authiroty];
if ($_SESSION['sess_guild'] == "forever") {
$sqla="SELECT * FROM forever WHERE user='".$_SESSION['sess_user']."'";
$sqlc="SELECT COUNT(id) FROM forever ";
$forever=mysqli_query($conn,$sqlc);
$iduser=mysqli_query($conn,$sqla);
$rowuser = mysqli_fetch_assoc($iduser);
$_SESSION['sess_id']= "$rowuser[id]";
$_SESSION['sess_giny']= "$rowuser[giny]";
}
header('Location:index.php');
}elseif(!empty($_SESSION['sess_guild'])){
echo "nooooo";
}
?>
i want when user click in profile
البروفايل
i need link get the sess_id from process when click this link
or i want if click on profile get link for profile like this https://stackoverflow.com/users/11227805/rashed-kamal
Hey i don't understand my website doesn't work i have don't do anything so i will explain
I got a 0 in top on my page now!
Google Chrome Explorator:Screenshot
https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.wisementrade.com%2F
View/header.php: https://pastebin.com/7GqFYR75
View/homepage.php: https://pastebin.com/3htmFSmw
View/footer.php: https://pastebin.com/b3X9KScg
Controller/View.php: https://pastebin.com/cxCdcdEQ
Chrome viewer code: https://pastebin.com/Q8VYja5u
I have check the encode UTF-8 and i have re encode UTF-8 with my sublime text but nothing change ... please need help
EDIT: FIXED
I guess unclosed HTML tag cause this problerm. I found a few unclosed HTML tag in your View/header.php. Close it. try this.
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--o-->
<?php
//Session
$customer_id = $this->session->userdata('customer_id');
$user_type = $this->session->userdata('user_type');
$statement = $this->session->userdata('timezone');
?>
<!--o-->
<link rel="icon" type="image/png" href="<?php echo base_url('images/favicon.png'); ?>" />
<meta name="author" content="Wise Men Trade" />
<meta name="copyright" content="Copyright Notice ©2015 WisemenTrade Limited and licensors. All rights reserved." />
<meta name="robots" content="all" />
<!--o-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script language="JavaScript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Bootstrap CSS -->
<link href="<?php echo base_url("css/bootstrap.min.css"); ?>" rel="stylesheet"/>
<!-- Basic CSS -->
<link href="<?php echo base_url("css/style.css"); ?>" rel="stylesheet"/>
<!-- Responsive CSS -->
<link href="<?php echo base_url("css/responsive.css"); ?>" rel="stylesheet"/>
<!-- Important Owl stylesheet -->
<link rel="stylesheet" href="<?php echo base_url("css/owl-carousel/owl.carousel.css"); ?>"/>
<!-- Default Theme -->
<link rel="stylesheet" href="<?php echo base_url("css/owl-carousel/owl.theme.css"); ?>"/>
<!-- MS DROP DOWN -->
<link rel="stylesheet" href="<?php echo base_url('css/msdropdown/flags.css'); ?>"/>
<link rel="stylesheet" href="<?php echo base_url('css/msdropdown/dd.css'); ?>"/>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-62333409-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
</head>
<body>
<!--top-header-->
<header>
<div class="header_block">
<!-- left -->
<div class="block_left">
<a href="<?php echo base_url(); ?>">
<img src="<?php echo base_url("images/log_wmt.png"); ?>" class="logo" width="130" height="130" alt="Logo Wise Men Trade" />
</a>
</div>
</div>
</header>
also in your Controller/View.php have a few unclosed div (<div id="container"> and <div class="block_content">). check it and close it.
the last, make sure at the end of your Controller/View.php have a :
</body> <!-- end of body -->
</html> <!-- end of html -->
According to the documentation (https://www.codeigniter.com/user_guide/general/views.html), you could load multiple views in your controller, I think it doesn't work if you load it in the view, so you should have something like this:
<?php
class Page extends CI_Controller {
public function index()
{
$data['page_title'] = 'Your title';
$this->load->view('header');
$this->load->view('menu');
$this->load->view('content', $data);
$this->load->view('footer');
}
}
The form contents are sent to my email but HTML and CSS code is not recognised on the email. Only plain text is outputted.
Below is my controller
public function registration() {
$email = $this->input->post('email');
$domain = $this->input->post('domain_name');
$passw = $this->input->post('passw');
$name = $this->input->post('name');
$skype = $this->input->post('skype');
// $package = $this->input->post('package');
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'xxxx.com',
'smtp_port' => 25,
'smtp_user' => 'xxx#xxxxxx.com',
'smtp_pass' => 'xxxxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('xxx#xxxxxx.com', 'welcome');
$this->email->to('xxxxx#xxxxxxxx.com');
$this->email->subject('registration');
$body = $this->load->view('dns/template', TRUE);
$this->email->message($body, TRUE);
$this->email->send();
$data['message'] = 'Submitted Sucessfullly';
$data['emails'] = $this->Dns_model->emails($domain);
$this->load->view('dns/sucessful', $data);
}
Below is my view saved as template.php
My view (template)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Registration</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/bootstrap.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/main.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/style.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/AdminLTE.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/sl-slide.css">
<script src="<?php echo base_url()?>/assets/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js'></script>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<?php echo base_url()?>/images/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo base_url()?>/images/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url()?>/images/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="i<?php echo base_url()?>/mages/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo base_url()?>/images/ico/apple-touch-icon-57-precomposed.png">
</head>
<body id="con" onLoad="generate();">
<div id="fb-root"></div>
<div class="container">
<section class="main-info">
<br>
<section id="recent-works3">
<section id="pricing-table">
<div class="row-fluid center clearfix">
<div class="span3">
</div>
<div class="span6">
<ul class="plan plan3">
<li class="plan-name">
<span class="lead3">Emails to be setup</span>
</li>
</ul>
<table class="table">
<thead>
<tr>
<th>Email</th>
<th>Password</th>
</tr>
</thead>
<tbody>
<tr class="info">
<td>info#test.com</td>
<td>terfwws6w</td>
</tr>
</tbody>
</table>
<ul class="plan plan3">
<li class="plan-action">
Registration website
</li>
</ul>
</div>
<div class="span3">
</div>
</div>
</section>
</section>
</section>
</div>
</div>
<script src="<?php echo base_url()?>/assets/js/vendor/jquery-1.9.1.min.js"> </script>
<script src="<?php echo base_url()?>/assets/js/vendor/bootstrap.min.js"></script>
<script src="<?php echo base_url()?>/assets/js/main.js"></script>
<script src="<?php echo base_url()?>/assets/js/jquery.ba-cond.min.js"></script>
</body>
</html>
I hope you are not using Parser library for email template, so bellow is my Answer by considering the above Condition.
You have problem with your template, means the Html code you wrote there, they have mismatched tag or some tag used in Wrong place. So you have to check that first.
If still you are not able to find out the problem then you just create a template using bellow code and You will see that the mail not more in normal text..
Nice, You nailed it...
NOTE: Don't use or etc tag and Also Use <table> instead of <div>
I have a 'header.php' file and I am incorporating it into my html pages using the following code:
<?php /*
$pageTitle = "Home";
$section = "Home";
include('inc/header.php');
?>
The PHP header file contains a number of CSS stylesheets. Some of these CSS stylesheets I only want to include on one page - e.g. I only want to include 'index.css' on the page 'index.php'. How can I include these stylesheets when I am using the same 'header.php' file in every page of the site?
Is there a way of specifying these styles in the individual pages themselves, rather than in the header file? If so, can these styles be placed in another element, even if the element has already been used (opened and closed) in the header file?
Here is the code for my 'header.php' file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;">
<title><?php echo $pageTitle ?> || Young Academy </title>
<meta name="description" content="Based in Pinner in North-West London, the Young Academy has been creating the highest standard of musical and dramatic education for 30 years.">
<meta name="keywords" content="Piano, Flute, Music Theory, Singing, Violin, Concerts, Pinner, Middlesex, Harrow, Teacher">
<meta name="author" content="Barbara Young">
<!--Stylesheets!-->
<link rel="stylesheet" type="text/css" media="all" href="css/reset.css"/>
<link rel="stylesheet" type="text/css" media="all" href="css/text.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/960_16_col.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/contact.css"/>
<!--Google fonts!-->
<link rel="stylesheet" type="text/css" media="all" href="http://fonts.googleapis.com/css?family=Quicksand:400,700">
<link href='http://fonts.googleapis.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Marck+Script' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,500,500italic,400italic' rel='stylesheet' type='text/css'>
**<link rel="stylesheet" type="text/css" media="screen" href="css/index.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/bgaudioplayer.css"/>**
<!--Meta tags!-->
<meta name="author" content="Robert Young" />
<meta name="copyright" content="2013 by Robert Young" />
<meta name="keywords" content="Music lessons, Pinner, music tuition, piano lessons, speech and drama, London" />
<meta name="description" content="Site of the Young Academy, a private music tuition business based in Pinner" />
<script src="../js/modernizr.custom.63826.js"></script>
<script src="../js/html5shiv.js"></script>
</head>
<body>
<div class="header">
<div class="container_16 clearfix">
<ul class="nav grid_16 alpha">
<li><a class="<?php if ($section == "Home") {echo "here"; } ?>" href="index.php" accesskey="1"> Home </a></li>
<li><a class="<?php if ($section == "About Us") {echo "here"; } ?>" href="about_us.php" accesskey="2"> About </a></li>
<li><a class="<?php if ($section == "What We Do") {echo "here"; } ?>" href="what_we_do.php" accesskey="3"> What We Do </a></li>
<li><a class="<?php if ($section == "Enrolement") {echo "here" ; } ?>" href="enrolement.php" accesskey="4"> Enrolement </a></li>
<li><a class="<?php if ($section == "Contact Us") {echo "here" ; } ?>" href="contact.php" accesskey="5"> Contact Us </a></li>
<!--<li> Blog </li>-->
</ul>
<div id="logo">
<img src="img/Logo original.gif" alt="The Young Academy"/>
</div>
<div class = "grid_4 alpha">
<div class="telephone grid_4 alpha">
<img src="img/phone_icon_white.png" alt="small telephone logo" class="align-left small" />
<p> +44 (0)20 8866 3813 </P>
</div>
<div class="timezone">
<p><?php
date_default_timezone_set('Europe/London');
mktime(0,0,0,1,1,1970);
echo date('l, d F Y');
?> </p>
<!--<form action="http://www.example.com/login.php">
<p>
<input type="text name=search" size="20+" id="search" value="Search this site"
</p>
</form>!-->
</div>
</div>
<ul class="secondmenu grid_6 push_3">
<li><a class="<?php if ($section == "Musical Glossary") {echo "here" ; } ?>" href="glossary.php">Musical Glossary </a></li>
<li><a class="<?php if ($section == "FAQ") {echo "here" ; } ?>" href="faq.php">FAQ</a></li>
<ul>
</div>
I want to include the stylesheets in bold only on the index.php page. Can I include them like this:
<?php
include('inc/header.php');
?>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="css/index.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/bgaudioplayer.css"/>
</head>
<article class="content">
<p class="grid_9 alpha"><i>Outstanding vocal and instrumental tuition.</i></p>
</article>
<article class="second-content">
<p class="grid_6 alpha omega">Develop a passion for music.</p>
</article>
<article class="third-content">
<p class="grid_5 alpha omega">Become a virtuoso.</p>
</article>
etc.
Any help would be much appreciated!
Thanks,
Robert.
I have just tried the above code and it happens to work! You can include head tags in both the header.php file and the main (index.php) site file.
Cheers!
long story short you need some sort of router. but Looking at your code it seems like you may not have a firm grasp on Object Oriented Programming. what you can do though is look at the URI with $_SERVER['REQUEST_URI'] if the string is lets say /about then load in resources for about-stylesheet.css.
You can do this with an if else statement that replaces the link to your CSS and refers to the unique variable you sent for the page you want to pull the CSS in for:
<link rel="stylesheet" type="text/css" media="screen" href="
<?php
if ($pageTitle == "Home") {
echo "css/index.css";
else ($pageTitle == "SomeOtherTitle") {
echo "css/relativelnk.css";
}
?>
"/>