I have a small problem.
On some of my pages I cannot make favicon to be shown.
On some pages everything is fine, and favicon is shown properly, however on other sites I cannot make the favicon to appear. I tried putting the ico file in the main directory, but without any results.
This file1.php is working fine:
<? include("core/config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="include/style.css" rel="stylesheet" type="text/css">
<title>Title</title>
<link rel="shortcut icon" type="image/x-icon" href="img/flavico.fw.ico">
<script type="text/javascript" src="include/script.js"></script>
</head>
However on this one favicon is not showing:
<?php include("core/config.php");
include("include/resolution.php");
function new_function($nazwa){
global $wys;
global $db;
$wys->some_function($ub,$na,$ub_pod);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<link rel="shortcut icon" type="image/x-icon" href="img/flavico.fw.ico">
<link href="include/style.css" rel="stylesheet" type="text/css">
</head>
I assume that this problem is caused by php functions, right?
Please show urls for both pages.
Guess your problem in relative urls. Assume that first url was http://mysite.org/file1.php and second was http://mysite.org/subsecrion/file2.php
then you should either use absolute path for favicon:
<link rel="shortcut icon" type="image/x-icon" href="/img/flavico.fw.ico">
or add tag:
<base href="http://mysite.org/">
Related
I'm building a website on Dreamweaver using PHP and its only the start of it.
include_once doesn't show the image. It only shows PHP in the design tab.
I've tried include also but that is also not working. I've tried for other files too, still the same problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Pickzone</title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
</head>
<body>
<div align="center" id="mainWrapper">
<?php include_once('template_header.php');?>
<div id="pageContent">test</div>
<?php include_once('template_footer.php');?>
</div>
Try adding __DIR__ in front of your includes to provide the full path on the disk. E.g. /var/www/path/to/file/on/disk/.
<?php include_once __DIR__ . 'template_header.php';?>
<div id="pageContent">test</div>
<?php include_once __DIR__ . 'template_footer.php';?>
See the php documentation for more information.
I want to use LESS, but it is doesn't work at my localhost.
Here is my index.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; utf-8">
<link rel="stylesheet/less" type="text/css" href="styles.less">
<script src="less.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
and here is my styles.less
#nice-blue: #5B83AD;
body{
backgroud-color: #nice-blue;
}
You shouldn't be using your less files directly in your HTML. Less is a CSS pre-processor, and needs to be compiled in order to be read by your browser.
Follow the examples here (http://lesscss.org/) on how to compile your LESS file so that you can use the CSS.
I'm doing a project where I am using Media queries for responsive design.
I have 4 media queries in total.
On computer, when I resize the browser I pass for all my media queries, its working perfectly.
On smartphone I dont understand why, I'm not getting any css.
Even if I do in my stylesheet outside media queries *{display: none;}, on my smartphone
the content appears.
Do you have any idea why this can be happening?
I have an index.php file where I do my css and js imports, and I have a function HomePage() that calls my homepage.
?php
ob_start(); session_start();
require_once('code/db.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="device-width, initial-scale=1, maximum-scale=1" />
<title>Untitled Document</title>
<link rel="icon" type="image/png" href="<?php setHome();?>/template/images/icon.png" />
<link href="<?php setHome();?>/template/css/styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php setHome();?>/template/fonts/fonts.css" />
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="<?php setHome();?>/template/acc/css/jquery-ui-style.css" type="text/css" />
<script type="text/javascript" src="<?php setHome();?>/template/js/jquery.js"></script>
<script type="text/javascript" src="<?php setHome();?>/template/js/scripts.js"></script>
<?php
HomePage();
?>
My setHome function:
function setHome(){
echo 'http://localhost/website';
}
If I import my css like this it works:
<link href="template/css/styles.css" rel="stylesheet" type="text/css" />
But Like this dont works: (But works on computer)
<link href="http://localhost/website/template/css/styles.css" rel="stylesheet" type="text/css" />
Like this also dont works: (But works on computer)
<link href="<?php setHome();?>/template/css/styles.css" rel="stylesheet" type="text/css" />
If that's your actual code, the answer is pretty straightforward
http://localhost
Will work on your computer, but when you access it from your phone, it's going to try to connect to the localhost i.e. the phone instead of the computer - you need to put your actual hostname or IP address in there instead.
I have a website that uses a global header.inc file, containing the header I want on top of every HTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="de-at" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="standard.css.php" />
...etc...
Hence, the pages themselves look like this:
<?php include "header.inc"; ?>
<title>Page Title</title>
<style type="text/css">
/* additional style sheets for only this page */
</style>
</head>
<body>
...
Obviously, Expression Web complains about the unopened </head> tag and ignores the stuff present in the header file (e.g., the stylesheet), which makes the preview pane rather useless.
Since EW4 is supposed to "work nicely" with PHP, is there some way to make the preview pane honor includes? I've told EW where it can find the php-cgi.exe, so in the browser preview everything works nicely.
I'm programming a website in PHP 5 and for convenience I've elected to use includes for the header and footer on each page.
My html and head setup looks like this atm, and had been unchanged since I started
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html lang='en'>
<head>
<meta charset='utf-8'>
<!--[if IE]><![endif]-->
<title>TITLE</title>
<meta name='description' content=''>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold&subset=latin' rel='stylesheet' type='text/css'>
<link rel='stylesheet' href='css/default.css'>
<link rel='stylesheet' href='css/bbeditor.css'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="js/jQuery.js" type="text/javascript"></script>
<script src="js/bbeditor.js" type="text/javascript"></script>
</head>
As you can see I use some jquery, a nice simple bbeditor for user input and the google font api. What started happening was that I could only load the last mentioned javascript file for some reason, in this case, it would be the bbeditor. not only that, the font api just wont load at all.
I should mention that the CSS files load perfectly fine however.
Does anyone know what's going on?
Try using firebug's "Net" tab, it will show you all the requests and responses. Firstly check the Status column and, if something's wrong, the response.
Try closing your one-line tags:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html lang='en'>
<head>
<meta charset='utf-8' />
<!--[if IE]><![endif]-->
<title>TITLE</title>
<meta name='description' content='' />
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold&subset=latin' rel='stylesheet' type='text/css' />
<link rel='stylesheet' href='css/default.css' />
<link rel='stylesheet' href='css/bbeditor.css' />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="js/jQuery.js" type="text/javascript"></script>
<script src="js/bbeditor.js" type="text/javascript"></script>
</head>
Note the /> at the end of link and meta tags.