Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 11-17-2004, 05:16 AM   #1 (permalink)
Contributing Member
 
Jason's Avatar
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 1,200
iTrader: 0 / 0%
Latest Blog:
None

Jason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really nice
Send a message via MSN to Jason
php includes-what have I done wrong?

I have saved my page as .php
I have inserted the code
Quote:
<?php include("menu.htm") ?>
with the intention of the menu (which can be found by clicking here) being displayed in every page of my site where I include the code above so I don't have to constantly update every page of my site when I make a difference to one link or add another, but I uploaded it but it hasn't worked. I have also looked into css files, but ideally I want this to work. Could someone look at my page and code and please advise me?
I would be so greatful.
Jason
The link to the main page is here. http://robotwarsfansite.atspace.com/example/include.php
Jason is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:04 AM   #2 (permalink)
Contributing Member
 
Join Date: 05-24-04
Location: Sydney, Australia
Posts: 479
iTrader: 0 / 0%
dcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nice
Hey mate,

I remember just the other day you were talking about this issue. I don't know too much PHP coding, perhaps your web server doesn't support PHP? I doubt this though.

To do what your trying to achieve, just use SSI includes.

For example: <!--#include virtual="menu.htm" -->

Put this code anywhere on the page where you want to insert the menu. Make sure the file extensions are changed to .shtml to support it.

Last edited by dcristo : 11-17-2004 at 06:07 AM.
dcristo is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:08 AM   #3 (permalink)
Contributing Member
 
Jason's Avatar
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 1,200
iTrader: 0 / 0%
Latest Blog:
None

Jason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really nice
Send a message via MSN to Jason
I can save in FrontPage .shtml files, it just doesn't come up on screen.
Jason is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:13 AM   #4 (permalink)
Contributing Member
 
Jason's Avatar
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 1,200
iTrader: 0 / 0%
Latest Blog:
None

Jason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really nice
Send a message via MSN to Jason
could you give me an example of where yhis is used in case I am inserting the code in the wrong place?
Jason is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:14 AM   #5 (permalink)
Contributing Member
 
Join Date: 05-24-04
Location: Sydney, Australia
Posts: 479
iTrader: 0 / 0%
dcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nice
Thats cause the SSI code is processed server side (not the browser). Upload the shtml files to your webserver and you'll be cheering. Just make sure the menu htm file is in the same directory as the shtml files on your server.
dcristo is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:17 AM   #6 (permalink)
Contributing Member
 
Join Date: 05-24-04
Location: Sydney, Australia
Posts: 479
iTrader: 0 / 0%
dcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nice
Quote:
Originally Posted by Jason
could you give me an example of where yhis is used in case I am inserting the code in the wrong place?
Say for example you had a left column menu. Place the SSI code between the <td> and </td> tags... get me?
dcristo is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:21 AM   #7 (permalink)
Contributing Member
 
Jason's Avatar
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 1,200
iTrader: 0 / 0%
Latest Blog:
None

Jason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really nice
Send a message via MSN to Jason
unfortunately my host can't take ssi. Do you know a free one that can?
Jason is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 06:29 AM   #8 (permalink)
Contributing Member
 
Join Date: 05-24-04
Location: Sydney, Australia
Posts: 479
iTrader: 0 / 0%
dcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nicedcristo is just really nice
free hosts always have their limitations
dcristo is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 07:42 AM   #9 (permalink)
SVB
Inactive
 
SVB's Avatar
 
Join Date: 10-13-03
Posts: 7,481
iTrader: 0 / 0%
Latest Blog:
None

SVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest orderSVB is a web professional of the highest order
Send a message via Yahoo to SVB
At the moment your code says
Code:
<body> <BR><BR><php include("http://robotwarsfansite.atspace.com/example/menu.htm") ?><BR> </body>
Change that to
Code:
<body> <BR><BR> <?php include("http://robotwarsfansite.atspace.com/example/menu.htm")?> <BR> </body>
SVB is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-17-2004, 10:31 AM   #10 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
And also to follow good convention
<?php include("http://robotwarsfansite.atspace.com/example/menu.htm"); ?>
If all instructions are on one line you don't need the ; - but it's good practice nonetheless
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-19-2004, 06:40 AM   #11 (permalink)
Contributing Member
 
Jason's Avatar
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 1,200
iTrader: 0 / 0%
Latest Blog:
None

Jason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really niceJason is just really nice
Send a message via MSN to Jason
Thanks, but...

Quote:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<p><!--webbot bot="HTMLMarkup" startspan --><body>
<BR><BR>
<?phpinclude("http://robotwarsfansite.atspace.com/example/menu.htm">
<BR>
</body><!--webbot bot="HTMLMarkup" endspan -->
</p>
</body>

</html>
Unfortunately, the code <!--webbot bot="HTMLMarkup" startspan --> has been added by frontpage. When I remove it the URL is spilt into design view. Though it doesn't show on the final layout, it still gets confusing. What should I do, or doesn't the 'Webbot bot' bit matter?
Jason is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-19-2004, 09:31 PM   #12 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
No - you do not need the following lines
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<!--webbot bot="HTMLMarkup" startspan --><body>
</body><!--webbot bot="HTMLMarkup" endspan -->

Notice there are 2 <body> tags - one set removed as per above.
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-20-2004, 09:28 AM   #13 (permalink)
Contributing Member
 
FGTH's Avatar
 
Join Date: 03-06-04
Location: NY, CT, CA, AZ
Posts: 574
iTrader: 0 / 0%
Latest Blog:
None

FGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to all
PHP includes should be...
Code:
<?php require("yourincludefile.html"); ?>
Make sure you enable includes in your .htaccess file... add the following to the top...

Code:
Options Includes AddType text/x-server-parsed-html .shtml
You can add more extensions by listing them in sequence...
Code:
Options Includes AddType text/x-server-parsed-html .shtml .shtm .html .htm AddType application/x-httpd-php .php
__________________
"90% of the game is half mental."
--Yogi Berra
Elizabeth Arden

Last edited by FGTH : 11-20-2004 at 09:38 AM.
FGTH is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong Traffic, Wrong Keyword for Wrong Site! Jonathan_Hue SEO Forum 22 03-18-2008 06:33 PM
PHP Includes & SEO Imperium SEO Forum 0 09-11-2007 05:41 AM
Forms and php includes Spiral Coding Forum 9 05-24-2005 09:50 AM
PHP includes GeXus SEO Forum 24 07-09-2004 03:32 AM
PHP dynamic includes vs ASP dynamic includes question! imaginemn Coding Forum 1 06-17-2004 07:55 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:38 AM.
© Copyright 2008 V7 Inc