Well, before I get too carried away making a whole lot of linked pages and filling in tabs...is there a way to call a menu.html file without it being a SSI?
when you say SSI do you
when you say SSI do you specifically mean 'SSI' or server side includes in general?
Sorry Wolfie...didn't
:bigoops: Sorry Wolfie...didn't realise there was a difference obviously.
What I was referring to is the little I've read, which is basically that server type 'calls' are inserted into the html to call/include the external menu.html when rendering the page.
I want to know if there is a way of doing it using an html statement in the html...don't know if I'm making myself clear :?
Yes, no, what clear?
Yes, no, what clear? mud?
You have to use an external mechanism such as PHP includes or SSI includes, but it's a simple enough process. If you have PHP available on the server then that would be my preference.
Hugo wrote:If you have PHP
If you have PHP available on the server then that would be my preference.
Mine too :thumbsup:
I was trying to edit my post
I was trying to edit my post but couldn't 'submit' so I knew someone was answering...
Double oops because I should have Ggogled first..in fact Googling is even better
So now I know that there is/was SSI which is a very simple way of calling/including my menu file.
So I should go and find out if FreeHostia supports this eh? On the other hand...
Not all servers permit SSIs. Most Apache servers do. Check with your host first. There may be additional configurations needed to run them. Usually the including document must be named with a ".shtml" suffix, and the server has to be set to permit this.
One problem with SSIs, from the hosting point of view, is they slow down server processing. Another is that they create certain security concerns.
Oh woe! What to do!
=====================
Yes, no, what clear? mud?
Precisely. Now you're going to tell me I have to go out in the big wide world again and deal with FH's control panel to find out what it's got? Oh Woe indeed! Isn't their an easier way? Do I really need a menu she asks plaintively :?
Sadly it doesn't look as
Sadly it doesn't look as though you do have PHP on Freehostia
:bigoops: yes it does, on all plans even the free ones so you're good to go
Aaaww...now what do I do?
Aaaww...now what do I do? No menu? After all our work?
Aaaww...now what do I do?
Aaaww...now what do I do? No menu? After all our work? What do you think...should I just copy it into every page and come back to externalising it when it goes up on the real server?
Ooeerk! We cross edited!
Ooeerk! We cross edited!
Okay...ready for instructions.
PH-Me
There's no doubt my website is awful at the moment, absolutely awful. I accept that and am working on a new one
However, I do have the menus included in basic PHP successfully and simply, so feel free to have a look at that if it helps.
Thanks John, I shall go and
Thanks John, I shall go and peruse it to see what I can make sense of :thumbsup:
Waaaaahhhh!!!!
Huuuuugggggggoooo!!!! Do I have to do THAT!?!
It's way past pumpkin time...I've been waiting for my browser shots, but I'm prolly going to fall off the queue (or the chair) before I get to the top of the list. What happens then anyway? How do you know you've been 'done' and where are they?
:?
Sorry buried in code; what
Sorry buried in code; what have you done?
Pages/files now need to end in .php rather than .html or .htm. The menu markup just the menu markup from opening ul to closing ul needs to be cut out and pasted to a new file call it something like menu.inc.php and placed in a new directory call it includes or just use your existing scripts directory (although where this file lives is not vital as long as you know the correct path to it)
Then where the ul list was i.e nested in that #wrap div? you place the php include call
Naturally if menu.inc.php is in another directory then append the path/name to the filename
One problem with PHP includes that you may have is that unless you are running a localhost server with PHP then you're not going to be able to see the include at work although it will work on the remote host.
So you may need to download and install a AMP package the simplest and best compiled package being XAMPP which is dead easy to install.
Okay then.... Hugo
Okay then....
One problem with PHP includes that you may have is that unless you are running a localhost server with PHP then you're not going to be able to see the include at work although it will work on the remote host.
Umm...I think I'd like to see that they're the same both locally and server side.
So you may need to download and install a AMP package the simplest and best compiled package being XAMPP which is dead easy to install.
Sooooo...I'm currently downloading the Windows "installer" version - had a bit of a dither as to whether it should be the "developer package" - if I'd be better off with that better tell me before I run the .exe - s'okay, I know about zips
Though I have to tell you it's only 30% loaded so I could probably stop it now, it's got about another hour to go by the looks of things.
Also - where does the csshover bit go? I'm, referring to the CC at the top of my index.html -
body {behavior: url(csshover.htc);}
PS - Those two "How to Code CSS & HTML" in the other thread should be a sticky don't you think? Maybe you could pass a note to TPH?
PSS - what do you think of my new boxes? Plain or patterned?
You should be fine with the
You should be fine with the basic windows package installer, you don't need the dev one.
The CC csshover goes where it is :? you could move it to your stylesheet then it technically invalidates the sheet due to the 'behaviour' property; if you mean once you have your server running ideally you try and mirror the host file structure and paths locally and remotely so that changes made locally can simply be FTPed up and will work without path modification.
What 'how to code html and css' and I have my own Aralldite!
Plain boxes, less border width though.
Oh goodoh on the basic
Oh goodoh on the basic installer.
The CC csshover goes where it is :?
Ummm...thought it had to be read every time the menu code was read - what I think you're saying is that I only need to include it in the index.html, not duplicate it all over the place? If this is so, then it can stay where it is.
The HTMLdog and HTMLsource recommendations you made in the W3C thread (plus a mini explanation - doesn't have to be an essay). And yes I know you have, but thought you may not feel like using it.
It's only 4px! Oh alright...
Oh I see, no you're right it
Oh I see, no you're right it does have to be read for each page, you might find it easier then to place it in the main stylesheet hidden with '* html'
Thought the borders seemed a little thicker than that , my preference would be for thinner, but that's me
I'll look at the thread, not sure it's stickified suitable though.
Dnload is finished and I've
Dnload is finished and I've started the install BUT it's asked me what service I want...see pic..do I need one? I'm guessing it's Apache if so.
Attachment | Size |
---|---|
XAMPP.png | 16.89 KB |
Personally I don't like
Personally I don't like things installed as services on windows boxes unless absolutely necessary (it essentially means that info is written to the Registry and that the server and various components are automatically run at boot up) this may suit you though, otherwise it means that you have to start and stop the server from the console each time manually, but there are shortcuts that can be used in the XAMPP root folder iirc for this
Perfect timing! I've
Perfect timing! I've finished cooking dinner and eaten it while reading about Coventry and Mr Carroll :ohdear:
No services then...I'd rather control what goes on thank you very much.
It was 5px now it's 4.
Can't get the cap off the Araldite then?
Oh it is one 'L' then
Oh it is one 'L' then wasn't sure
In the top level folder of the Xampp install you should find a series of .bat files these will run the command line instructions to start and stop apache, mysql, etc; you can just copy them to the desktop and they should work ok; once started opening browser and typing http://localhost/ should present the XAMPP splash page
I just saw that I missed one
I just saw that I missed one of your posts...
Oh I see, no you're right it does have to be read for each page, you might find it easier then to place it in the main stylesheet hidden with '* html'
Okay then we'll try that...
Borders were 5px - amazing what a difference 1px makes to those! 3px was very skinny...but I rather like the 3D look - amazing that colour actually works for 'outset' in both browsers...looks better in IE }:)
No - I don't think the W3C thread is appropriate...I meant make a new one with just the link info and a bit of blurb or maybe use the other thread "A good beginner CSS book" instead and put both the links in properly.
NOW...
I installed XAMPP then read the instructions - please see piccy - I'm up to step 3 and when I paste either of those in FF it tells me that
Firefox can't establish a connection to the server at 127.0.0.1.
*sigh* I'm beginning to think my mother was right, she always said I was an awkward child and she didn't mean clumsy
( Just caught myself quoting FF as Hugo...I'm so used to typing it, don't know why I bother really since you know who you are )
Attachment | Size |
---|---|
XAMPP-wont start.png | 30 KB |
The setup batch file says
The setup batch file says there's nothing to do :?
EDIT: HA! Found an Apache start 'n stop and sent them to the desktop and started it and now the browser works...I get there in the end roundabout though it may be
Howsumever...PHP only has php-switch.bat not start and stop :?
Attachment | Size |
---|---|
setup_xampp.bat_.png | 15.93 KB |
Yeah the start and stop .bat
Yeah the start and stop .bat files were where I said they would be !!!
There isn't a start or stop for PHP it doesn't run like that it's a module, part of Apache and just receives and processes instructions when the server sends them to it.
btw be careful as it looks as though those instructions you referred to earlier are the zip file ones? don't get procedures mixed up
"Bout time.... BAT files
"Bout time....
BAT files - yes alright cleverclogs And yes I double clicked the start one and it says -
"Please close this command only for shutdown" (then)
Apache 2 starting
...and that let me log on to the test thingy in the browser at http://localhost. It's still open, (.bat) I gather I have to leave it open on the desktop as long as I want to play on my local server. However. Given the instruction above, what do I need the "apache_stop.bat" for if the start one will shutdown when I close it?
What do I do with the php-switch.bat? I'm not allowed to run them together - I tried and it told me off
But I tell you...instructions are ruddy few and far between with this thing. It's all done with mirrors I tell you.
What do I put in the browser bar to run my page - mit includes - locally, on my brand new dandy little server thingy??? It doesn't like any of the combinations I try. In fact at the moment it's telling me Access Forbidden contact the webmaster :?
Whew!
If you've got to the xampp
If you've got to the xampp main screen there is a menu on the left on there is a section for tools it list the php switch function although you don't need to worry about using this at the moment.
You can simply close the cli window but it's a slightly dirty method, the stop batch file runs some cli switch options to close apache and clear certain log files; your choice though it won't do any harm.
You will need to make a folder for your files under the root directory, this is simplest but does mean that you have to be aware of paths between your server and remote host as they will differ slightly
you will have something like htdocs/yourfolder/index.php which will be navigated to by http://localhost/yourfolder/
There are better methods of working things but they involve setting up vhost entries in the httpd.conf file and that is beyond the scope of discussion at the moment.
Quote:One problem with PHP
One problem with PHP includes that you may have is that unless you are running a localhost server with PHP then you're not going to be able to see the include at work although it will work on the remote host.
Actually now I don't see them anywhere
Let's deal with the server first.
I created my 'phpincludes' folder and put the menu-inc.php file in it. Menu-inc.php has nothing in it except the ul code.
Have put the ?ph bit in my pages
No menu
Can't really give any sort
Can't really give any sort of response based on that info; insufficient data.
My earlier overview of setting up a php include was fairly exacting.
Quote:Pages/files now need
Pages/files now need to end in .php rather than .html or .htm.
I created menu-inc.php - I'm assuming index.html, facets.html and nasm.css etc stay the same.
The menu markup just the menu markup from opening ul to closing ul needs to be cut out and pasted to a new file call it something like menu.inc.php
I cut it out, made a new file and called it menu-inc.php since I don't like double dots in file names.
and placed in a new directory call it includes
It's called phpincludes.
(although where this file lives is not vital as long as you know the correct path to it)
C:/nasm/phpincludes/menu-inc.php = <?php include('/phpincludes/menu-inc.php'); ?>
Then where the ul list was i.e nested in that #wrap div? you place the php include call
<?php include('menu.inc.php'); ?>
Which bit did I not do?
"which bit did I not do "
"which bit did I not do " :rolleyes:
quote "I'm asuming that index.html...will stay the same"
Nope otherwise I would have said they did. any file that is or contains php scripting must end with .php this is how the server knows that the file must be sent first to the php engine for any script instructions to be processed before being passed back to the server to be sent as per the http request by the browser
Double extensions are fine and you will come across them where you have no choice in the matter, it's only the stupid OS Windows where they were exploited.
Your path to the file described is a os system path that can work but suggests that your files are not actually within the server directories and using paths such as that will have to be changed as they won't work on the remote host, so try and stick for the moment to relative paths.
the php include path looks ok and should work on the remote host as that is an absolute path from the doc root directory beginning as it were with the root slash '/' meaning read from top level but you show that as having a duoble extension when you said earlier that you were using a dash to seperate.
Grrrrr!!!
:curse: This is the bit that would have made it plain after knowing (at newbie level) one must have an index.html for anything to work!
any file that is or contains php scripting must end with .php this is how the server knows that the file must be sent first to the php engine for any script instructions to be processed before being passed back to the server to be sent as per the http request by the browser
At the moment the directory setups mirror each other locally and on the server - and all file specs are relative and work just fine.
the php include path looks ok and should work on the remote host as that is an absolute path from the doc root directory beginning as it were with the root slash '/' meaning read from top level but you show that as having a duoble extension when you said earlier that you were using a dash to seperate.
Nooo...the double extension is your example - mine is the one above it with the name with the dash. :rolleyes:
EDIT: However...
1) Server side now works fine.
2) Localhost now works...ummm sort of fine, (when you click a link it goes very small and black, I didn't touch the list anchors and even when I refresh it opens at the last page I was on instead of the Home page) but...
3) PSPad doesn't seem to want to read the include...pity about that.
Lots of little changes, you can now go to top by clicking the sparkle at the bottom...and "Rosa's Books" is up, please tell me what you think. The footers and text are still all over the place because there's one more duck before I can get stuck into them.
Hugo originally wrote:
The menu markup just the menu markup from opening ul to closing ul needs to be cut out and pasted to a new file call it something like menu.inc.php
Hugo wrote:
The menu markup just the menu markup from opening ul to closing ul needs to be cut out and pasted to a new file call it something like menu.inc.php
I cut it out, made a new file and called it menu-inc.php since I don't like double dots in file names.
So what does that menu include file actually contain?
You must get in the habit of validating the pages to catch errors.
Aaaaw jeepers Hugo.....I
Aaaaw jeepers Hugo.....I took you at your word...
Hugo originally wrote:
The menu markup just the menu markup from opening ul to closing ul needs to be cut out and pasted to a new file call it something like menu.inc.php
The validator tells me of course that I have no doctype...(I cut and pasted the code into the "validate by direct input" seeing it's a php file).
Are you telling me that it should go between the head tags of a new file which has all the other gumpf up top? I didn't read that as being implied above.
Does everything have to be a ruddy cryptic crossword?If you say "just this" - then that's what I do, just that. Otherwise I still get growled at for "not" doing what I was told. Sheeesh! I can't [email protected]#$&%!
Smee wrote:Aaaaw jeepers
Aaaaw jeepers Hugo.....I took you at your word...
And if you had you shouldn't have had problems :?
Quote:Hugo originally wrote:
The menu markup just the menu markup from opening ul to closing ul needs to be cut out and pasted to a new file call it something like menu.inc.php
The validator tells me of course that I have no doctype...(I cut and pasted the code into the "validate by direct input" seeing it's a php file).
It seems as though things are getting mightily confused here, what did you originally cut and paste into the menu include file ? it should have been exactly as I said just the ul markup I can't make that any simpler.
Of course if you validate just that file contents pasted into the online direct input validator it will complain as it validates complete pages only, what I don't understand is at what point did you try this? originally? and then panic as the validator threw an error so you put in the DTD that it said was missing?
Are you telling me that it should go between the head tags of a new file which has all the other gumpf up top? I didn't read that as being implied above.
I think you are overthinking things, my instructions were straightforward and to the point and if followed should have resulted in an include I can't really respond to this paragraph as I don't really get what you're saying.
Does everything have to be a ruddy cryptic crossword?If you say "just this" - then that's what I do, just that. Otherwise I still get growled at for "not" doing what I was told. Sheeesh! I can't [email protected]#$&%!
It's not cryptic and I am not growling!!
You may have thought that you followed the "just this" instructions but I fear that somewhere you haven't so please don't reproach me for that, I am trying to help.
One last explanation of an include:
The thing/element/markup that one wishes to have repeated across pages is removed from the pages i.e the ul construct opening ul to closing ul this snippet of markup is then placed in a new file and given an appropriate name.
Your page now has no menu! but still functions as all the required page elements are there i.e dtd, head elements stc.
Now clearly one wants a ul menu to re-appear on the page and any subsequent pages so the php include function is used to call up the file that now holds the
ul markup; this include is placed in exactly the same position occupied by the missing ul.
When the page is now processed, it reaches the php include function and at this point it trots off to the processor to run the include.
What an include does is examine the file and include the contents of that file at the position occupied by the php function.
So the file contents are written to this position and is simply the ul markup nothing else thus you now have a complete page once more with the ul where it should be, and the same will happen for all other pages that have that same include function all calling in the same file.
Remember though that this menu file can not validate on it's own it's a snippet of code not a complete page, only the final page as outputted to the browser may be validated.
Perhaps you didn't see my
Perhaps you didn't see my EDIT in the post before last?
1) I can see the menu in both browsers
2) It works on the server and on localhost
3) I validated the file after reading your last post implying menu-inc.php was full of errors. In fact I've just done everything again - my css validates except for the *html #container. There's nothing wrong with the include as far as I can see, I did what you asked the first time. The html has 5 errors to do with my sparkle-to-top thing.
This is menu-inc.php as it has been from the time you first told me to cut it out - all of it.
Home
- link
- link
- link
link
About
- link
- link
- link
- link
- link
- link
- link
link
Library
Mediums
Photos
- link
- link
- link
- link
link
Links
This is down to and including what I put in its place in the index.php when I removed the ul-to-ul to its own include file -
body {behavior: url(csshover.htc);}
function reflow() { var header = document.getElementById('header'); header.style.border=header.style.border; var bar = document.getElementById('bar'); bar.style.border=bar.style.border; var photo = document.getElementById('photo'); photo.style.border=photo.style.border; var curlybar = document.getElementById('curlybar'); curlybar.style.border=curlybar.style.border; } window.onload = reflow;
I actually felt really pleased when I made that EDIT: about 4 hours ago... both browsers were working in both places, with the menu and I had a new page to boot
No I did see the edit in
No I did see the edit in your earlier post which is why I trotted off to have a look at things and why I responded with the post that I did.
I don't really want to get in an argument or debate over this.
This is what I see in your menu include file
New Age Spiritualist Mission
About
- link
- link
link
Library
Mediums
Photos
- link
- link
link
Links
Is this an acurate representation of what's contained in the file? or something nutty going on?
Quote:I don't really want to
I don't really want to get in an argument or debate over this.
...and I don't either. Good Grief! I reckon if I never get this thing up and live there's at least a book in these threads - we're better than any soap opera!
Alright...
Is this an acurate representation of what's contained in the file? or something nutty going on?
No, it is not an accurate representation of what I originally did or what I have now or what I'm seeing in either browser and I have just shut them both down to clear the cache.
I think I did that file for about 5 mins last night before re-reading posts and concluding I was right the first time and changing it back, because I did see the menu strung out like that at one stage.
However I must have forgotten to reload the file to the server, and you got it instead but I don't know why I haven't :? and I know I've been careful to specify the url as either local or remote.
So I have just re-loaded it to the server (the bare code I posted above) and I did notice that the file I deleted was dated yesterday.
In fact I've just deleted and reloaded all the major files to make sure. Sorry Hugo.
So Is it any better now?
So Is it any better now?