Page 1 of 1
Help for a newbie with PHP
Posted: Wed May 26, 2010 1:56 am
by jofield
Hi guys
I'm very new to using PHP and CSS etc. and am trying to update my website to include these new languages in order to make my life a little easier in the long run.
I have a menu on my website that needs updating once a month and so wanted to set it up in an external PHP page so I only have one page to amend rather than every page in my website that I current have to amend in html.
The only problem is I can't get the menu to display and I can't work out why!!
I wonder if you would be so kind as to take a look for me and see if you can work out where I've gone wrong. I'm sure it's just a stupid little error somewhere!.
I've tried attaching the pages so you can see the code but each time I do it tells me I'm not allowed to upload that file extension, so anyone that can tell me how to get round this I would greatly appreciate it. and here is a link to my test site for you to see what's happening
http://www.fieldshypnotherapy.co.uk/newsite2/
I really appreciate any help that can be offered.
Many, many thanks
Jo
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 2:50 am
by requinix
A file named index.html will not normally run PHP code. It needs a .php extension.
Are you sure your server supports PHP in the first place?
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 9:29 am
by mikosiko
jofield wrote:.... I have a menu on my website that needs updating once a month and so wanted to set it up in an external PHP page so I only have one page to amend rather than every page in my website that I current have to amend in html.
Jo,
Why do you need to do what you described in PHP?.... you can do it simply splitting your current pages in:
- header (only one file for the whole site)
- content (this is each individual page)
- footer (only one file for the whole site)
and use #include to mix the header/footer with your content...
here is an example that could help you
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 10:10 am
by jofield
Hi mikosiko
Many thanks for your suggestion, it is really helpful, and far simpler than the way I was trying to do it, however, I still cannot seem to get the menu to display, It is supposed to be displayed in the left hand side, pinky coloured column, any ideas where I might be going wrong?....
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 10:12 am
by jofield
tasairis wrote:A file named index.html will not normally run PHP code. It needs a .php extension.
Are you sure your server supports PHP in the first place?
Hi, yes my server does support PHP. I have downloaded a template from Webshapes which I have adjusted to include my colour scheme, but the file extensions were already .html in the template so I left them as that....
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 10:58 am
by mikosiko
jofield wrote:I have downloaded a template from Webshapes
that is a totally different game then
I don't know the template that you are using but most likely is relaying 100% in CSS to positioning your page elements... therefore you must first check if the template allow you to define/setup vertical menus otherwise you will have to adapt the CSS (you are learning CSS right?) of use other template that suit you best
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 11:29 am
by jofield
Oh no I was hoping you wouldn't say that! Yes the template does use CSS, I've spent ages getting it looking how I want and just had this last bit to do of separating the links section into a separate file before I was ready to go with it!! That will teach me hey! Do you know any good resources where I may be able to find the help I need, or at least a more suitable template??
Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 11:41 am
by mikosiko
yup... the template that you are using is a regular 3 columns...
that provide you:
- header
- navigation area (your menu)
- left side - center - right side
- footer
here you can find more templates
http://www.freecsstemplates.org/
I like the menus at the top... that give you more space to the left to include more content using your template... but as always... "beauty is in the eyes of the beholder"

Re: Help for a newbie with PHP
Posted: Wed May 26, 2010 11:53 am
by jofield
Thanks mikosiko I shall check that site out, time to start from the beginning again! Will make sure I get a template that has separate files set up for the navigation section in the first place this time
Unless of course, you know of any quick fixes you could explain to a novice like myself that would enable me to adapt the existing template I have to have a separate navigation file that you would be prepared to share to save me having to start from scratch again
