473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

A direct url within an include

I am trying to put a direct url in this form <?php
include("messageboard.html"); ?> is it possible and what is the code?
What I am trying to do is link to a footer that opens on all pages. Any
help would be appreciated.

Nancy

May 2 '06 #1
4 1796
Nancy wrote:
I am trying to put a direct url in this form <?php
include("messageboard.html"); ?> is it possible and what is the code?


It is possible and you've just given the code. Or do you experience problems
when doing it like this?
JW
May 2 '06 #2
all u need is to make some HTML page and put in it any content for your
footer then in any php page in your site at the end of your code add
this code :-
<?
include("footer.htm");
?>
and change footer.htm with the URL of your HTML page - if it is located
in the same dir with all o fyour php files so put it in this form
include("footer.php"); and if located at a remote server for example
you can use this form include("http://yahoo.com/footer.htm"); only for
example

if you have any more problems - reply again

Ahmed ,

May 2 '06 #3
the footer is on the site but not in the same folder. We have tried the
short link of footer.html and also http://mydomain.com/footer.html and
neither has worked

May 3 '06 #4
include('somefile.ext') assumes that somefile.ext is in the same
directory as the PHP file containing the include statement. If the
included file is in another directory, for example the parent
directory, then you need to call include('../somefile.ext'). Realizing
that this can be something of a PITA when trying to include it in files
that may be spread over multiple directories, my suggestion is to
define a constant that points to the physical path to the application
root, which would allow you to do something like the following:

//in constants.php included into all page requests
define('APP_ROOT', '/opt/websites/mysite/');

//somewhere else in the application
include(APP_ROOT . 'includes/somefile.ext');

May 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Deane Barker | last post by:
I have a function that selects a file to include, then includes is. The file is including within the function, like so: function include_file($file_name) { require $file_name; return; }
8
by: Clifton M. Bean | last post by:
First, I defined three classes (listed below): =========== // 1st class =========== class PointCl { public: PointCl & operator= (const PointCl & rgh ); //define as usual assingment operator
3
by: Steve Kreis | last post by:
Somebody help. The bloggers are driving me nuts. They are direct linking to images on my site thus driving up my traffic to an artificially high level. What I would like to do is prevent them from...
5
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are...
1
by: acrocker | last post by:
I would like to provide access to users who need to be taken directly to the relevant page without further navigation instructions. Unfortunately the page I want to access is built using a...
16
by: digitalorganics | last post by:
What's the difference between initializing class variables within the class definition directly versus initializing them within the class's __init__ method? Is there a reason, perhaps in certain...
5
by: Remco van Engelen | last post by:
Hello, I have a question regarding the ISO C grammar. The syntax of a direct-declarator reads (section A.2.2, page 413 in my copy; the (R1) is just to 'name' the rule for later reference): ...
3
by: subramanian100in | last post by:
Consider the following program: #include <iostream> #include <string> using namespace std; class Test { public:
88
by: santosh | last post by:
Hello all, In K&R2 one exercise asks the reader to compute and print the limits for the basic integer types. This is trivial for unsigned types. But is it possible for signed types without...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.