Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

php include()



This may be as basic as it gets but it still eludes me.

I want to include the following html code in several different documents, the goal being to have the ability to change the code in one location and have it automatically appear in several.

<p class="navigation">
<a href="index.html">Home Page</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
About the CVP PAC
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="contact.html">Contact the CVP PAC</a>
<br /><br />
CVP PAC Endorsements
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="contribute.html">Contribute</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
Volunteer
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="http://www.cvppac.org/minutes/index.html";>Minutes</a>
</p>

I remember this little trick from my first readings about php. I went to the php online manual and decided that include() appears to be the function I should be dealing with. I created a file, called it navigation.txt and attempted to call it in the original page with the following command <?php include 'navigation.txt'; ?> which didn't work. I then tried
<?php include('navigation.txt'); ?> and then
<?php include(navigation.txt); ?> and then
<?php
include('navigation.txt');
echo 'navigation.txt';
?>
and several others. I even changed the filename to navigation.php and tried it with and without the php tags.


Any suggestions for me?

TIA. John.
_______________________________________________
web-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/web-development
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.