Jump to content

Recommended Posts

Ok i tried to use the search funtion but the word require is everywhere.

 

i'm really new to creating websites... I've built them in the past but allways had some sort of template to go off of from a friend. I'm trying to do it myself with help only when needed so i've tried to figure this out and just can't get it right... i know i can use the css and php to call for pages using the include and require functions but I can't figure out why it's not working...

i'm using

<?php include("header.php"); ?>

 

and it's not pulling up header.php even if I put the entire url in the ""

why would this be?

Link to comment
https://forums.phpfreaks.com/topic/178757-solved-php-require-help-needed/
Share on other sites

yes same directory...here is header.php

 

<?php
<HTML><HEAD><TITLE>Welcome to the Lair of Dracolas Legomore!</TITLE>
<link href="style.css" ; rel="stylesheet" ; type="text/css" />
</HEAD>
<body>
<body Background="http://dracolas.webs.com/pics/background.jpg">

<div class="nav">
<a STYLE="text-decoration:none" href="/index.htm"><img src="pics/home1.png" onmouseover="this.src='pics/home2.png';" onmouseout="this.src='pics/home1.png';" /></a>
<a href="http://z6.invisionfree.com/The_Dracolas_Forums/index.php"><img src="pics/forums1.png" onmouseover="this.src='pics/forums2.png';" onmouseout="this.src='pics/forums1.png';" /></a>
</div>
<div class="content">
?>

 

by the way.. i know that the div's are right because if I just put it all on the index page it works fine..

First try this

<?php
error_reporting(E_ALL);
include("header.php");
?>

this should tell you and errors that are occurring, if that doesn't then check the file has a .php extension ie index.php NOT index.html

 

also you could create a file called phpinfo.php with the following code

<?php
phpinfo();
?>

open it in the browser (ie http://localhost/phpinfo.php)

that should give a ton of info.

 

if it doesn't then something is wrong with the installation

Thank you guys... new problem... why doesn't it like the <

Parse error: syntax error, unexpected '<' in /home/a1237238/public_html/header.php on line 3

header.php

<?php
<link href="style.css" ; rel="stylesheet" ; type="text/css" />
<body>
<body Background="http://dracolas.webs.com/pics/background.jpg">

<div class="nav">
<a STYLE="text-decoration:none" href="/index.htm"><img src="pics/home1.png" onmouseover="this.src='pics/home2.png';" onmouseout="this.src='pics/home1.png';" /></a>
<a href="http://z6.invisionfree.com/The_Dracolas_Forums/index.php"><img src="pics/forums1.png" onmouseover="this.src='pics/forums2.png';" onmouseout="this.src='pics/forums1.png';" /></a>
</div>
<div class="content">

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.