Jump to content


Newbie: Advice for navigation


7 replies to this topic

#1 Andy82

    Young Padawan

  • Members
  • Pip
  • 13 posts

Posted 17 March 2008 - 10:07 AM

Hey,

I am just starting to learn PHP, I have my template all ready and divided into header, content and footer files and using PHP to include them into the index.php (Is this a good method?)

I have seen numerous ways of people including content using ‘switches’ and ‘GET ‘ and am confused what is the correct way to include content.

Can someone please advise me what is a ‘good’ way to set up navigation? or where I can find some information to do with this?

Thank you

#2 BigDog

    Young Padawan

  • Members
  • Pip
  • 277 posts
  • Gender:Male
  • Location:Orange County, California
  • Interests:Running, building computers, PC games and BMX and programming.

Posted 17 March 2008 - 06:38 PM

No real 'Good' way of doing it. There are more efficient and it usually comes down to preferences.

I personally use the get method to switch between pages.

 
$page = $_GET['section'];
if(!isset($section)) {
include("indexpage.php");
}
else if(isset($section) && $section == "about") {
include("aboutus.php") 
}
else ....


#3 tjl30

    Young Padawan

  • Members
  • Pip
  • 67 posts
  • Gender:Male
  • Location:MA
  • Interests:Graphic Design, Website layouts, Website scripting, movie editing, animation, snowboarding, sculpture, and drawing.

Posted 17 March 2008 - 08:43 PM

It totally depends, one way to do it is to write out your entire page in HTML, and have all the content within different divs call different functions of a controller class. A simple include works just as good, as well as a case switch statement. What ever you prefer really, as long as its easy for someone to understand what you are doing.

#4 Andy82

    Young Padawan

  • Members
  • Pip
  • 13 posts

Posted 18 March 2008 - 07:00 AM

Thank you for the replies :angrylooking: .

One other thing, can you recommend any good books for learning PHP that are on e.g. Amazon? I have been looking through them and don't want to spend about £60 on a couple of books that are not the kind of thing I need. Being completely new to PHP what sort should I buy? A general PHP book? one for PHP 5? and there are several for PHP 6???

This is probably a popular question, but just a point in the right direction would be greatly appreciated.

Thank you.

#5 tjl30

    Young Padawan

  • Members
  • Pip
  • 67 posts
  • Gender:Male
  • Location:MA
  • Interests:Graphic Design, Website layouts, Website scripting, movie editing, animation, snowboarding, sculpture, and drawing.

Posted 18 March 2008 - 02:06 PM

This is my favorite book Beginning PHP5, Apache, and MySQL Web Development

I have the PHP bible, and its not that great, I would not buy it. Out of the three books I own, that is by far the best for a beginner. After that the Zend Developer Zone is your best resource.

#6 BigDog

    Young Padawan

  • Members
  • Pip
  • 277 posts
  • Gender:Male
  • Location:Orange County, California
  • Interests:Running, building computers, PC games and BMX and programming.

Posted 18 March 2008 - 06:07 PM

Sorry but i can't recommend a book, but i learned all the PHP I know how from P2L and php.net :angrylooking:

The best book is the free one :P

#7 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 18 March 2008 - 06:23 PM

View PostBigDog, on Mar 18 2008, 11:07 PM, said:

Sorry but i can't recommend a book, but i learned all the PHP I know how from P2L and php.net :angrylooking:

The best book is the free one :P

I wouldn't exactly sum it up in those words, but the idea is right there. There is no need to spend money on books when you have the whole internet as a free resource, as php gets more advaned a book won't update itself, you would need to keep buying new ones.

Like BigDog said you have P2L which has a whole range of tutorials from simple new stuff to more advanced stuff, and php.net is your bible for learning php.

Matt

#8 tjl30

    Young Padawan

  • Members
  • Pip
  • 67 posts
  • Gender:Male
  • Location:MA
  • Interests:Graphic Design, Website layouts, Website scripting, movie editing, animation, snowboarding, sculpture, and drawing.

Posted 19 March 2008 - 05:43 PM

View PostMr. Matt, on Mar 18 2008, 07:23 PM, said:

View PostBigDog, on Mar 18 2008, 11:07 PM, said:

Sorry but i can't recommend a book, but i learned all the PHP I know how from P2L and php.net :)

The best book is the free one :)

I wouldn't exactly sum it up in those words, but the idea is right there. There is no need to spend money on books when you have the whole internet as a free resource, as php gets more advaned a book won't update itself, you would need to keep buying new ones.

Like BigDog said you have P2L which has a whole range of tutorials from simple new stuff to more advanced stuff, and php.net is your bible for learning php.

Matt

I disagree with that, to me I find that books are a great starting point. I just don't like reading a lot on my computer. Once you know a programming language then I find tutorials, and online resources to be best for inspiration and advancing your learning. But thats just me.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users