switch
Nov 28 2005, 07:50 AM
| | Hey guys
I'm overhauling my website and have decided instead of using frames I want to just have a logo and buttons integrated into each HTML file, so you can just scroll down past it. I want the logo at the very top, before any content.
I was wondering if there is any way of doing it with an HTML tag (i.e. not PHP or any other scripts) so the header just gets inserted right after the opening <BODY> tag. I'm thinking that possibly it uses the <link> tag, but really I don't have much of an idea.
Thanks in advance for your suggestions.
Peace out  |
Comment/Reply (w/o sign-up)
Tyssen
Nov 28 2005, 08:54 AM
It sounds like you're talking about server side includes.
Comment/Reply (w/o sign-up)
Avalon
Nov 28 2005, 12:22 PM
I think the simplest way to do this is to use a javascript that has the information you want and then insert the script in the page where you want it. Unlike PHP or ASP etc. a javascript will work on almost any web host, essentially it is just inserting a text file. Here's a very simple example for inserting a logo image and some buttons, note the use of single quotes around the image and page names. CODE document.write("<img src='my_logo.jpg'><br>") document.write("<a href='contact_page.html'><img src='contact_button.jpg'></a><a href='search_page.html'><img src='search_button.jpg'></a><a href='gallery_page.html'><img src='gallery_button.jpg'></a>")
Save the above text in a file called 'mynav.js' and upload it to your web server. Then to display it on a page, just insert the following script tags at the position on the page where you want it to display, in your case it would be immediately after the '<BODY>' tag as shown below. CODE <html><head><title>My Web Site</title></head><BODY> <script src="mynav.js"></script> The rest of your page code goes here....
You can use pretty much any html code you like, just so long as you replace any double quotes (") with single quotes ('). Experiment a little to see what you can do. As you can see from the example above, if you are going to insert a large amount of html, you can do multiple 'document.write' statements. I hope that helps. 
Comment/Reply (w/o sign-up)
jlhaslip
Nov 28 2005, 04:44 PM
Avalon, If your approach is used, does the html code you insert via javascript get the css applied to it if the css is in a css file?
Comment/Reply (w/o sign-up)
sportytalk
Nov 28 2005, 05:03 PM
In my website, i gave up with standard frames because in my opinion, they looked pretty ugly and most web-authoring programs nowadays include framed pages as part of their standard templates, hence meaning users think you're just using a template rather than actually going ahead and creating the website yourself. I have, in the past, used IFrames, still based along the idea of frames, although they allow you to place frames almost anywhere on your webpage, meaning you don't have to worry about loads and loads of code. Only problem with frames, or anything relating to frames, is that not all internet browsers support these (yet). It's best to use php when at all possible. Even WebTV, a prime example of a basic browser, can access the php and perform the functions. If you can't use php, try to use tables in html! Hope this helps
Comment/Reply (w/o sign-up)
Tyssen
Nov 28 2005, 10:36 PM
QUOTE(Avalon @ Nov 28 2005, 10:22 PM) I think the simplest way to do this is to use a javascript that has the information you want and then insert the script in the page where you want it. Unlike PHP or ASP etc. a javascript will work on almost any web host, essentially it is just inserting a text file.
It may work on almost any host, but unlike server side scripting languages, javascript can be turned off which means that users of your site will be missing whole chunks of the page. W3Schools figures show that about 10% of users have js turned off which is a very large slice of your audience who won't be able to use your site properly (especially if you're using it to display your navigation. Stick with server side includes (they can be configured to work with HTML, no scripting languages required) - they're the industry standard.
Comment/Reply (w/o sign-up)
Avalon
Nov 29 2005, 01:18 PM
QUOTE(Tyssen @ Nov 29 2005, 09:36 AM) It may work on almost any host, but unlike server side scripting languages, javascript can be turned off which means that users of your site will be missing whole chunks of the page. W3Schools figures show that about 10% of users have js turned off which is a very large slice of your audience who won't be able to use your site properly (especially if you're using it to display your navigation. Stick with server side includes (they can be configured to work with HTML, no scripting languages required) - they're the industry standard. You make an excellent point, I didn't realise that many people turn off js. To clarify things a little here, perhaps you could explain what server side includes are, how to use them and any restrictions they impose. @jlhaslip Yes, the html you insert is affected by css like the rest of the page.
Comment/Reply (w/o sign-up)
Tyssen
Nov 29 2005, 10:04 PM
QUOTE(Avalon @ Nov 29 2005, 11:18 PM) To clarify things a little here, perhaps you could explain what server side includes are, how to use them and any restrictions they impose.
They work in a very similar way to the js method you posted. You create a file with the piece of code that's to be inserted into another file and then you write a line of code in that file that calls the include. For PHP it looks like this: CODE <? php include('yourfile.htm') ?> In ASP and HTML it looks like this: CODE <!-- #include virtual="/yourfile.htm" --> Some configuration of the server is required to get it to work for HTML as it is not usually enabled by default. PHP, ASP, JSP, Coldfusion etc. all enable them by default. You can call any file to include in your document: .htm, .txt, .inc, .asp, .php. In fact, you can write scripting code in a .txt file and it'll work as intended if it is included in a file with the relevant extension (e.g. .asp or .php). I'm not aware of any restrictions (except if you're server isn't configured to accept them which wouldn't be the case if you're using Trap17). The benefits over the js method is that they can't be turned off and rather than being written to the page as javascript, they get written as HTML (or whatever else you've included).
Comment/Reply (w/o sign-up)
switch
Nov 30 2005, 09:09 AM
ok, thanks everybody, i'll definately take a look at that. i'm sort of actually leaning more towards a client side thing though, would there be any feasible way of doing that? thanks heaps for your help and advice guys, i really appreciate it
Comment/Reply (w/o sign-up)
Tyssen
Nov 30 2005, 10:29 PM
QUOTE(switch @ Nov 30 2005, 07:09 PM) i'm sort of actually leaning more towards a client side thing though, would there be any feasible way of doing that?
Why are you leaning towards client side when, as already pointed out (twice), if it's client side, the client can turn it off (whether intentionally or not)? Which when you're talking about the actual code of your site, is a bad thing.
Comment/Reply (w/o sign-up)
Tyssen
Jan 16 2006, 01:12 AM
QUOTE(jlhaslip @ Jan 16 2006, 10:56 AM) Okay, thanks for the answer Tyssen, however, by way of PM from Buffalohelp, I have information which suggests I stop with this Html Include stuff because Trap17.com does not support them. Now that I know this, I will continue with php includes only.
(apperently, Html includes is a MS ASP construct and trap17 is Linux, so that's why they aren't supported here.)
I actually wrote a post that said something like that the first time, but something happened and it didn't get posted, so the 2nd time around I just went for the quick approach.
Comment/Reply (w/o sign-up)
jlhaslip
Jan 16 2006, 12:56 AM
Okay, thanks for the answer Tyssen, however, by way of PM from Buffalohelp, I have information which suggests I stop with this Html Include stuff because Trap17.com does not support them. Now that I know this, I will continue with php includes only. (apperently, Html includes is a MS ASP construct and trap17 is Linux, so that's why they aren't supported here.)
Comment/Reply (w/o sign-up)
Tyssen
Jan 16 2006, 12:03 AM
For SSI, it's the same as an absolute URL: CODE <!-- #include virtual="/testinclude/header.html"-->
Comment/Reply (w/o sign-up)
jlhaslip
Jan 15 2006, 03:17 PM
So then the follwing code should work if it is saved into an shtml file, but it doesn't. CODE <!-- #include virtual="/home/jlhaslip/public_html/testinclude/header.html"--> <h2>Content here h2 </h2> <!-- #include virtual="/home/jlhaslip/public_html/testinclude/footer.html" -->
Are there any corrections that should be made to the syntax? It works okay if I use the php version. And in the php file, the full path must be in the include. I tried several other paths and this is the one that works. Shortening it to '/testinclude/header' fails as do all the ones in between.
Comment/Reply (w/o sign-up)
Tyssen
Jan 15 2006, 08:42 AM
QUOTE(OpaQue @ Jan 15 2006, 05:52 PM) <? ?> PHP include statement. The file name extension should be .php
<!-- #include virtual="/yourfile.htm" --> SSI include statement. The file name extension should be .shtm or .shtml
No, that's incorrect actually - you can include any sort of file, even .txt files. The file calling the include must have the correct file extension, but it doesn't matter for the include itself.
Comment/Reply (w/o sign-up)
Recent Queries:--
open another file in html - 7.98 hr back. (1)
-
integrating two html pages on single page - 35.32 hr back. (2)
-
insert code file in html document at point - 54.77 hr back. (1)
-
how do i include one html file inside another? - 79.15 hr back. (1)
-
insert a webpage in an html file - 81.09 hr back. (1)
-
integrate html in iframe page - 82.52 hr back. (1)
-
include one html file into another - 95.68 hr back. (1)
-
embed external html file into another - 127.48 hr back. (1)
-
how to include one html file into another html file client side - 135.90 hr back. (1)
-
how to include one html file into another html file - 140.79 hr back. (1)
-
html embedding one html page into another - 147.84 hr back. (1)
-
include a smile file in html page - 158.09 hr back. (1)
-
how to include another html in html - 180.78 hr back. (1)
-
html show text from another file - 193.01 hr back. (2)
Similar Topics
Keywords : integrating, html, file, embedding
- W3schools.com Is Down
Ask your CSS/HTML/PHP questions here... (7)
Html Code Question
(2) Hi all, I was wondering is there a way I could make a field in a form that will take you to the
address you enter in it? (in other words) Site: trap17.com (go) and clicking go takes you to
trap17. I will explain why. What I have done is set up a page with frames, I've got all my
most visited sites on the left, and I browse in the right, I want to make a frame up the top of the
browsing window that will be like the address bar, Just to retain this framed setup. (I will put a
google box in it too). Alot of you are probably wondering why, its for purely aesthetic....
Some Questions On Html
(10) I was just curious on how people here learned HTML or XML (assuming you did, which, judging by the
fact you are actually here on this board). How long did it take for you to learn the basics of HTML?
How proficient are you right now in HTML? Which resources did you use when you were learning HTML
(or are currently learning HTML?). How did you find learning HTML? Thanks.....
Help Making A Web Adress Bar Using Html/js
(9) Hey I need to make an adress bar basically you imput into the field press enter and your away but it
cant use php or any code that needs to be installed, its all part of a workaround for my school
interenet!....
Html Ascii Codes - A Complete List
downloadable php file (3) I was often frustrated at how, despite there being thousands of ASCII "special characters" such as
&8659; , websites that claimed to list them all only listed the first 256. To combat this issue, I
have created a table which lists the first 10,001 - from to &10000; I am sure there are many
more but it is simply not feasible to create a table with many more rows as viewing it would put
terrific strain on the browser.! You can download the file in two forms. One uses PHP to
dynamically create the table (1KB), the other has it ready-made in pure HTML format (437KB....
Html Div Help [resolved]
help with the divs in ipb (1) hey guys, as you may know, i have ipb 2.3.4 set up on my site. i am currently using the centura
skin and like it a lot. i have customised the header bar in terms of the logo, however also want a
slab of text linking to the forums home at the top of the banner. i have so far managed to achieve
this to work in firefox (see attached screenshot), however it just screws up in ie, opera and safari
(i think). the link is here here is the code, both html and css, of the ipb header, and i have
placed between stars the parts i have edited: CODE the css (only the edited....
Iframe Src = A Local File In My Computer
(6) Is it possible to call a file, i.e. 1.htm, from my web browser using such tag HTML iframe src
=" file:///C:/1.htm "> /iframe > file:///C:/1.htm is the correct path since when I enter it
to my web browser's address box it shows up properly. But when I use the same call function in
my PHP it does not. My situation is that I'm running Apache with PHP, therefore I am running my
own mimi-webserver on my computer. There's no risk of someone else accessing my file because
it's for my testing purpose. I thought it had to do with some Apache settin....
Best Way To Protect Html Form Fields
Looking for suggestions on how to protect form fields during user inpu (3) My working example is here http://sonesay.trap17.com/application.php The form submits to itself
and stores what ever the user inputs into session variables. Thats all fine and I have validation
checks for it, I wanted to add more and I remember comming across a site where they would lock from
fields to prevent any changes if the information was already supplied and validated. I'm looking
to build something similar but cant seem to figure out how to get that same effect at this time.
Heres my program logic so far application.php includes('application_content.....
Html Application Form
(6) does anyone know how to make a form/application that when you submit the form with the submit but it
sends it in a email to you email address if anyone on here knows please please let me know thanks, i
want this so i can have members apply for a team on my football site and there information will come
back to me and i can accept or reject them for that job....
Login In Using Html
(12) I have looked around and I can't find any code to help me out. I want to make it so you can log
in to my site to get member featues. Could some one please help me....
Wanna Learn Html From Scratch
downloade an online tutorial,formatted my c: lost it forever,and FORGO (5) id prefer something i can download .....coz my internet connection is highly intermittant Moved
from the Java section to the HTML section. ....
Help With Css/html Layout
Horizontal List Problems (5) I can't figure out why this horizontal list isnt working. Underneath my banner is supposed to
be a green gradient bar with a list of links in the center of the page. The links are all the way
to the left and are really small. The banner is also overlapping the list for some reason. This is
my current layout(don't worry, I'm not trying to advertise).
http://www.stormgaming.net/stormcreations/ This is my CSS file
http://www.stormgaming.net/stormcreations/storm.css Thanks in advance for any help.....
Html Help
(6) ok so i need help again i was wondering how i can make a navigation bar that looks like this
Free Website Templates Information Slide
Show Pictures title="Time Line"> Time Line
Im having a problem putting the names of things that i want to go in those four boxes i tried to put
in names but it didnt show up so i was wondering if anyone could give me some help....
Some More Help With Html
(2) Ok so yet again i need some help i have this so far: CODE Pearl Harbor
i have two images on the right and a video on the
left but i dont know how to put two more pictures right underneath the ones on the right without
something moving and also i used the to make a break underneath the video and i had to use to
move it down and i know you can use but i am pretty sure there is another way that i can do it
without using those so if anyone can give me any kind of help that would be awsome.....
Ok Background Help Please
html (4) OK so i've given up on the paint for background now how would i get it to look like this
http://img.photobucket.com/albums/v614/Dj1.../background.jpg without using paint and without it
coming out to look like this... http://img.photobucket.com/albums/v614/Dj169211/Damn.jpg like,
with just html code, not trying to use paint and do the BS any ideas?....
Help With Html
(11) Ok so i just started learn html about a couple of weeks ago and i make a background image using this
code: CODE body {
background-image:url("http://img.photobucket.com/albums/w59/tuhyd/backgrounds.jpg");
background-repeat: no-repeat} and i am having trouble putting my text on the top in the center
becasue my links are on the left every time i try and move the text up it moves the links down and
separates them and i don't know what to do. added code tags. please use appropriate bbcodes as
needed. ....
How To Display Php Code [resolved]
Html Help With Php Codebox (8) I'm trying to make codebox for my guestbook so that users can post PHP code inside.. I tried
many versions but none of them works If i use , or i can display HTML code, but when i try to
write PHP code it executes it does not display.. There is a way to make swap for You have codebox
in forum to display php how can i make that?! thanks....
Html Query
HTML Query (2) OK, so I want to know if it's possible to have my links as a seperate file and simply reference
that file in the rest of my site's pages so that if I change the links, I don't have to go
and edit every single page of my site. Does anyone know how to do this?....
Having Html Troubles......
Please help! (1) I'm having troubles with the background colours on the HTML pages on my site
keri-j.trap17.com Basically, the colors are hex codes and i'm no HTML n00b, god no! But, I just
can't figure this one out! I have the background colour in the body tag (duh) " " on all my
pages but on some of them the background is white. This might be to do with some javascript i have
recently edited in each page or certain errors but whatever it is i can't figure it out! This
is my homepage with the correct background color This is my poetry page with the faulty colour c....
Wanting To Touch Up/learn My Html Again
(27) Ok, well recently i realized that i am not as skilled in HTML (such as building website layouts) as
i want to be, with tables etc... and so i was thinking about going through many many many many many
many sites and just touching up on my HTML and see if i can code my own website template before
starting to learn PHP because that is what i want to do. so, i am asking all of you experianced
people on trap17 what websites did you use to learn your HTML skills, yees i know i could go to
google and type in learn html or somthing along the lines of that, but i want to know wh....
Error In Css (or Html)
(5) Well i am currently working on a project, and for this i need to fix this little error: Code is:
CODE $this->frm .= " .style1 {color: #000000}
--> {$this->top}
Edit Username
Insert Username:
....
Have You Used This Html Code?
very useful (9) how do you do if you want to put a video or audio file on you page...maybe you will use CODE
/*simple format*/ CODE /*simple format*/ there is a very familiar code for carring
out the video show : CODE /*an example:FF7*/ have you used this html code...I just knew a
tag can achieve video play that is really cooool /smile.gif" style="vertical-align:middle"
emoid=":)" border="0" alt="smile.gif" />....
Creating Link In Html - Help Me With This!
(5) edit: Neeeaavverrrminddd..... I was a total noob at php when i posted this and I needed help doing
something with bbcode in php and didn't really know what I was saying.. /blush.gif"
style="vertical-align:middle" emoid=":blush:" border="0" alt="blush.gif" /> Anyway topic
resolved.......
Html Question Concerning Pre Tag And Code Tag
(8) My question is, why would anyone use the CODE tag when you can use the PRE tag? 1. The PRE tag
recognises white space, the CODE tag does not. 2. The CODE tag requires that you escape some
chars, the PRE tag does not. I cannot see anything that the CODE tag achieves that is special apart
from sounding as though it is perfect for displaying code which IMO it is not. Thanks. ....
Html And Javascript
Not php as first indicated... (12) Edit your ScrollBar colors Change "Your color", to color code, that u need. CODE BODY {
scrollbar-face-color: Your color; scrollbar-highlight-color: Your color; scrollbar-3dlight-color:
Your color; scrollbar-darkshadow-color: Your color; scrollbar-shadow-color: Your color;
scrollbar-arrow-color: Your color; scrollbar-track-color: Your color; } --> Insert Date
Place this code between , tags CODE var today_date= new Date() var
month=today_date.getMonth() var today=today_date.getDate() var year=today_date.getYear()" var
months = new Array(....
Do You Know Html?
Just Wondering, most of you would know. (65) Well I was just wondering, i know this polol might sound stupid, as this is a hosting site forum and
the chances are you do know HTML, but the other day i met 2 people who didt have a clue what HTML
was, and was just at the forum because they found this forum active. And also do you know any other
programming languages, just wondering. I myself know HTML, C++ kinda, and learing PHP. Talking about
Languages I know Tamil, English, Lote /tongue.gif' border='0' style='vertical-align:middle'
alt='tongue.gif' /> .....
Html Templates
HTML Templates for website (4) Where do i get free HTML Templates to use in look and feel of website? Any link will be
helpfull....I know there are some free templates available but it is hard to find even by
gooooogling it. Please, share if you have any. Thank You.....
Html Editor
non WYSIWYG (22) What editor can I download and use that isn't a WYSIWYG(what-you-see-is-what-you-get) and is
free. Currently I use NotePad but I want something better.....
Html Cool Codes?
(6) hey guys..whats up..well i ws just wondering if you guys have any cool codes for myspace or
something..you know to design a page using html/css codes...see i tried googling around but all the
sites had the same thing..they dont have a unique one...i want like games in my page...like my
friend he had like tetris in his page..and i want a game// or anything like that to make my page
cool /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' />
anybody????plz...PEAcE!....
where did you learn html from?
(100) HI, i am intresting in knowing where you began learning html of what inspired you to start learning
html. which programs did you use or which progs dyu use?....
Looking for integrating, html, file, embedding
|
Searching Video's for integrating, html, file, embedding
|
advertisement
|
|