How do i : Embed a .html into another .html page
Started by bbr, Nov 06 2007 06:50 PM
10 replies to this topic
#1
Posted 06 November 2007 - 06:50 PM
Ok, here's my issue.
I'd like to embed a html into another html.
In detail, i have 3 pages, and 1 page with the "navigation bar".
I'd like to embed the navigation bar page into each of the other pages so that i don't have to copy paste the navigation bar into each of the other pages anytime i make a change to it.
Now, frames would obviously be an option, but i think that's a bit outdated and ugly.
the <object> tag seems to have the option to do what i need,, but i'm not sure if its fully compatible with all browsers i use (firefox, safari, ie7).
Perhaps there's a more widely accepted option to do this with?
Hopefully someone can give me an insight in this.
I'd like to embed a html into another html.
In detail, i have 3 pages, and 1 page with the "navigation bar".
I'd like to embed the navigation bar page into each of the other pages so that i don't have to copy paste the navigation bar into each of the other pages anytime i make a change to it.
Now, frames would obviously be an option, but i think that's a bit outdated and ugly.
the <object> tag seems to have the option to do what i need,, but i'm not sure if its fully compatible with all browsers i use (firefox, safari, ie7).
Perhaps there's a more widely accepted option to do this with?
Hopefully someone can give me an insight in this.
#2
Posted 06 November 2007 - 06:54 PM
A server side language such as php or asp can do that for you.
Have a look at the w3schools tutorials about that topic.
Your Hosting service *may* have the php or asp software for you to use, but *some* Hosts do not allow it. Check with your Service provider.
Have a look at the w3schools tutorials about that topic.
Your Hosting service *may* have the php or asp software for you to use, but *some* Hosts do not allow it. Check with your Service provider.
#3
Posted 06 November 2007 - 07:05 PM
jlhaslip, on Nov 6 2007, 07:54 PM, said:
A server side language such as php or asp can do that for you.
Have a look at the w3schools tutorials about that topic.
Your Hosting service *may* have the php or asp software for you to use, but *some* Hosts do not allow it. Check with your Service provider.
Have a look at the w3schools tutorials about that topic.
Your Hosting service *may* have the php or asp software for you to use, but *some* Hosts do not allow it. Check with your Service provider.
Cheers for the quick reply, i'll give a poke to one of the admins.
Hopefully it's possible.
#4
Posted 06 November 2007 - 07:32 PM
One method to check to see if you are able to run php is to cut and paste the following code into a file named test_for_php.php, upload it to your Host and then use you browser to navigate to the page on your Hosting account.
(http://www.yourdomai...est_for_php.php)
Change the yourdomain value. of course.
It replies with an error if you are not able to use php and gives you a whole bunch of info about the php configuration if it is enabled on your account.
Or a simple phpinfo() would work, too.
Same thing, upload it as a php file and navigate to it using your browser.
(http://www.yourdomai...est_for_php.php)
Change the yourdomain value. of course.
It replies with an error if you are not able to use php and gives you a whole bunch of info about the php configuration if it is enabled on your account.
<?php $inis = ini_get_all(); echo '<pre><br />'; print_r($inis); echo '</pre><br />'; ?>
Or a simple phpinfo() would work, too.
<?php phpinfo(); ?>
Same thing, upload it as a php file and navigate to it using your browser.
#5
Posted 06 November 2007 - 09:05 PM
jlhaslip, on Nov 6 2007, 08:32 PM, said:
One method to check to see if you are able to run php is to cut and paste the following code into a file named test_for_php.php, upload it to your Host and then use you browser to navigate to the page on your Hosting account.
(http://www.yourdomai...est_for_php.php)
Change the yourdomain value. of course.
(http://www.yourdomai...est_for_php.php)
Change the yourdomain value. of course.
Shame, but seems i can't upload php files to begin with.
Quote
The file extension: php is not supported
I guess i'll have to settle for a pure html solution for now, unless i can bribe an admin
#6
Posted 06 November 2007 - 09:51 PM
Can you use XML and XSLT files? If so, you could use XML to store per-page data and transform each one with a single XSLT file containing the common data. Read on the XML and XSLT tutorials and test if this is allowed on the server.
The greatest difficulty in programming is not in finding answers, but in asking yourself the right questions. -- If nobody has said it before, then I'd like to take credit of thinking this up (during summer of 2010).
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a3) - reliable sockets.
PEAR2_Cache_SHM(0.1.1) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a3) - reliable sockets.
PEAR2_Cache_SHM(0.1.1) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.
#7
Posted 06 November 2007 - 09:55 PM
boen_robot, on Nov 6 2007, 10:51 PM, said:
Can you use XML and XSLT files? If so, you could use XML to store per-page data and transform each one with a single XSLT file containing the common data. Read on the XML and XSLT tutorials and test if this is allowed on the server.
Seems i'm restricted to: css, html, gif, png, jpg
So no xml either.
I've mailed 2 of the admins, hopefully some more file formats will be allowed for upload soon.
#9
Posted 07 November 2007 - 01:14 PM
The complete list of types i can upload is :
"Allowed Types: gif, jpg, jpeg, png, swf, html, css, txt"
So, even .js is currently unavailable unless i put it directly into the .html file.
Ah well.
This "seems" to work for now, not happy with it though. (its very slow, and doesn't seem to work properly in IE)
Some tweaking required still.
Edit: added div to center it in IE as well. Seems ok now.
If you wish to replicate this, make sure you put target="_parent" in any hrefs in the linked page object.
Edit2: doesn't work on windows.... ugh.
Edit3: ok blast.. i don't see any way to get it working.
on mac-safari it works perfectly.
on mac-ie5,6,7 whatever it works fine.
didnt try mac firefox, but i suspect itll work.
at home, on windows xp with ie7, all i see is a blank box.
i'm clueless...
"Allowed Types: gif, jpg, jpeg, png, swf, html, css, txt"
So, even .js is currently unavailable unless i put it directly into the .html file.
Ah well.
This "seems" to work for now, not happy with it though. (its very slow, and doesn't seem to work properly in IE)
Some tweaking required still.
Edit: added div to center it in IE as well. Seems ok now.
<div id="nav" align="center"> <object type="text/html" data="linktest.html" width="600" height="40" align="center"> <param name="BorderStyle" value="1" /> <param name="MousePointer" value="0" /> <param name="Enabled" value="1" /> </object> </div>
If you wish to replicate this, make sure you put target="_parent" in any hrefs in the linked page object.
Edit2: doesn't work on windows.... ugh.
Edit3: ok blast.. i don't see any way to get it working.
on mac-safari it works perfectly.
on mac-ie5,6,7 whatever it works fine.
didnt try mac firefox, but i suspect itll work.
at home, on windows xp with ie7, all i see is a blank box.
i'm clueless...
#11
Posted 08 November 2007 - 07:50 AM
It must be windows specific then, as the object tag works fine on IE 5.2 on the mac.
Quite strange.
Quite strange.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users















