Hello all,
I've made some posts on this forum before and everybody has been very helpful. I wish I could give something back but, unfortunately, I just can't get the gist of coding in general. My objective is to get this site that I have been farting around with for the past year working properly. I thought that I figured out everything I needed to know a few months ago, but basically I'm back because I've discovered larger, much more complicated problems 🙂
Here are my issues:
1.) I've underestimated the complexity of this IT stuff. I feel like I'm not learning things in the right order and wasting time. Stated simply, I don't know what the correct order to learn programing is or how to make graduated steps so that I keep building my knowledge in a reasonable amount of time. I've attended local PHP groups and some folks say start with Ruby on Rails, other say start learning the C language, and others say start with PHP. I've bought some books and feel like I understand the remedial concepts but have yet to find an applicable example I can emulate or way to apply the things I've learned to my objective.
2.) My learning environment might be less than Ideal. I have installed PHP and Apache as a localhost and have had mixed results. I feel that I configured the programs OK but am not sure if this is the best way to get started. Everyone at the PHP meetings I have attended like to execute stuff from the command line and use this PuTTy thing. Is this a better way to learn? Furthermore, some of my URL's take me out of localhost and onto my live stuff. I've found this matter frustrating.
3.) All of these other things keep getting in the way. I've found that in order to learn PHP, I need to know about Apache, .htaccess, .ini, PEAR and who else knows what.
- Most of the working examples I've discovered are not complete or omit some very important piece of the puzzle. For example, the site I am striving to build is going to have markup, content, and presentation segrated, basically ideal OOP. One of the few working sites I know of sent me some code that looks like this:
<div id="main">
<?php if($_SESSION[ 'pages' ][$id][0] != "0") { // if it's not a section 0 page ?>
<div id="nav">
<?php
if(!$id) {
include('nav/1.html');
} else {
include('nav/' . $_SESSION[ 'pages' ][$id][0] . '.html');
}
?>
</div>
<?php } ?>
<?php if(!$id || $id == 'home') {
include('content/home.html');
} else { ?>
<div id="content">
<?php if($SESSION[ 'pages' ][$id][2]) { // this is a sub-page
include('content/' . $SESSION[ 'pages' ][$id][2] . "/" . $id . '.html');
} else if( $month ) { // this is an archive
include( 'content/' . $id . '/' . $month . '.html' );
} else {
if (file_exists( 'content/' . $id . '.html' )) {
include( 'content/' . $id . '.html' );
} else {
include( 'content/404.html' );
}
} ?>
</div>
<?php } ?>
<?php include('nav/footer.html'); ?>
</div>
I understand everything that is going on here except for the most important part: how the global session[ 'pages' ] variables figure out what page to grab, and why the sub arrays? are numbered [0], [1], and [2] respectively. I'm sure that there is another page to it, and I've found another post here that has a somewhat similar example, but I still can't put all of the pieces together. How are the damn $id's called? The URL's output stuff like: http://www.isphpforme.com/?id=docs&f=1
- If you surf the web enough, eventually all of the coding experts contradict each other. Some folks say that you should not include get variables in your URL's while others say it's fine and that Googlebot as well as its friends will index your page properly. Assuming that I can solve my earlier problems, Is it a huge pain in the butt to use strict OOP, completely eliminate redundancy, and have pretty URL's that look like http://www.isphpforme.com/thesolution/download/
Sorry this turned our really long.
-Mike