PDA

View Full Version : Embarking on my first serious coding. need advise on direction to take.



Urumiko
04 Nov 2010, 04:39 AM
Hi guys.

I apreciate this may be a rather long post but im going from the concept of more info is better here. I really would appreciate the effort taken to assist me very much :)


To give you the background I have a friend who has a small business website which is rather tacky and thought i'd have a go at trying to spruce is up as it currently looks like some kind of lame diet pill website or somthing.

My background in IT is strong but programming wise pretty week. I have used C++ and did one project for uni several years ago using css/php/SQL but i remember very little at all.

The current website my friend has in use is a basic html page mage with tables. It has all kinds of inconsistencies etc because of this.

I have proceeded to create an index.php file (why i picked php? thought this would be the way to go)

It contains the following Divs (kind of made the notation up as ive gone allong here to illustrate my point but have used propper divtags in the project).

<main wrapper>

<header>
<banner>
<>
<main navigation bar>
<><>
<centre(main content)>
<subcat navbar(left)><> <content(centre)><> <right spacer(right)> <><>
<footer>
<><>

the size etc of these divs is deffined in a .css file

my initial desire having no real experience was to try and stick to php and css since these are the only web languages other than html i have ever seen in action (not that i remember much) I also figured this would be a good choice in terms of old browser compatability issues compared to other scripting languages, as the users of the site will most likely be silver surfers, so the concept of keeping things up to date or using fancy navigation may be alien to them.

having a little experience in C++ programming (though being a bit scared of the concept of popper scripts in web design) i wanted to try and use a dynamic element to promote consistency through the site without having to re-write every page from scratch.

The concept in my head would be to somehow treat the divs on my page almost like frames so that only the main content div of the site will ever change.

I came across one snippet on the net which suggested using the php include function to include the source code for my header, footer, and nav bar divs so these are consistent. This sounds like a good plan to me.

Presumably if using this method i would have to create separate master pages using an include based template then vary the code in the main content div. If i get stuck i may well go for this option but i would like to go one better by sticking on my index page and refreshing it, changing the content of the main page by loading different php files in to the main content area depending on the navigation bar button clicked.

Question 1 what would the code to do this look like? as far as i can see get/post could be used somehow but posting is only for forms not hyperlinks? as such you can kind of fake a php variable in a hyperlink such as "index.php?page=page1" .. ignoring the issues this can cause for a sec. how do i get from a url containing "page=page1" to extracting the variable from the url and executing "include page1.php"

Question 2I've heard the common solution uses java script / ajax to dynamicly update content but the thought of including yet another language I dont understand doesn't thrill me, id rather stick to php if possible as i dont mind refreshing and there is no sensative data being passed in the urls. is this possible given what i want to do?

Question 3I think i remember somthing called I frames being used for this in html as another solution. Are they a good / bad solution? can they be seamlessly integrated in my layout style?

Question 4where i see my current intended php method becoming unstuck is if i have a subcategory navigation bar which changes based on the main page selected, as i then need to pass 2 variables (the category page im on, and the sub category page i wish to nest within this. so hyper-links definitely couldn't be used? what are my options?

thanks for reading :)

if you dont have time to reply to all points feel free to single out any you can help with.:laugh: