Jump to content

function fails to include file


Lassie

Recommended Posts

I have a simple site to build and am trying to includer a header file.

My structure is to functions from an overall require file (ab_fns.php).

At present there is only a display_fns.php to include. which loads a header and a stylesheet.

This does not happen.

Can anyone help please.

link http://217.46.159.226/authorbank/index.php

display_fns.php

 

<?php

function do_html_header()
{
?>
<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Authorbank</title>

<link href="./includes/layout.css media="screen"
rel="stylesheet" type="text/style" />
<?php	
}
?>
ab_fns.php
[code]
<?php
include_once ('display_fns.php');

?>

[/code]

 

Link to comment
Share on other sites

I have checked the path and it seems in order.

For example,http://217.46.159.226/authorbank/includes/layout.css gives the css.

In my code the link is <link href="./includes/layout.css" media="screen"

rel="stylesheet" type="text/style" />

I cant see whats wrong. I have tried ../ and.../ which i wouldnt expect to work.

i have used the same set up before and it works.

Link to comment
Share on other sites

Look at this code:

 

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

Actually, looking at your actual site, it wasn't spaces, it was a tab. The forum here just changed that tab to spaces. Either way, you need to get rid of the blank tab before the opening bracket (<). So it should look like this:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.