1

(17 replies, posted in PHP)

rsrwebs wrote:
abajan wrote:
rsrwebs wrote:

...This stuff is beginning to make less and less sense to me...

If by "stuff" you're referring to PHP in general, take heart, rswebs. Have you viewed the beginner PHP videos by Stef Mischook (frog)? They're the most easy to understand tutorials on PHP I've ever come across. I have tried learning PHP before and quit because it just seemed too overwhelming at the time but after watching Stef's videos, I have resolved to learn as much as I can about it.

Hey, thank you! Where can I find these tutorials? smile

Here's the entire list of the tutorials. You'll notice that not all of them can be linked to from that page. Most of others can be found at Idea22.com with slightly different titles in some instances but they are the same videos. I'll post the direct links when I get a chance.

(EDITED to correct original link to the beginners PHP tutorial.)

Hi all

Today the company that repairs my computer alerted me to a critical Firefox update.
Read more.

3

(17 replies, posted in PHP)

rsrwebs wrote:

...This stuff is beginning to make less and less sense to me...

If by "stuff" you're referring to PHP in general, take heart, rswebs. Have you viewed the beginner PHP videos by Stef Mischook (frog)? They're the most easy to understand tutorials on PHP I've ever come across. I have tried learning PHP before and quit because it just seemed too overwhelming at the time but after watching Stef's videos, I have resolved to learn as much as I can about it.

4

(17 replies, posted in PHP)

falkencreative wrote:

I looked over your code a bit, and I have to admit I'm a bit confused... Maybe it's that you haven't posted the entire files, but they seem to be set up wrong. For example, with those two files you have two sets of body tags... it just isn't what I would expect.

For example, here is a brief example showing a php include used to include navigation elements:

Index.php file:

<!-- doctype here -->
<html>
<head>
    <title>title</title>
</head>
<body>
  <div id="wrapper">
      <div id="header">
          <!-- logo here -->

          <?php include("nav.php"); ?>

      </div>
      <div id="content">
          <!-- content here -->
      </div>
   </div>
</body>
</html>

nav.php:

<ul id="nav">
    <li>nav item</li>
    <li>nav item</li>
    <li>nav item</li>
    <li>nav item</li>
</ul>

I was wondering the same thing. From what little I know about PHP and programming in general, the include file should contain just the navbar code and nothing else, as you have rightly shown above, because if the navbar were to be wrapped in body tags, the resulting index.php source would have body tags contained within body tags. (A page can only contain one set of body tags, and html tags for that matter, isn’t that right?).

But now that I mention it, something along the same line of reasoning has me puzzled about Includes: Last night, while viewing the PHP Includes video (part 2) and practicing my coding, I noticed that in order for the declared variable contained in footer.inc.php to work, it must be wrapped in PHP tags. But that doesn't make any sense to me because if I were to put that section straight into my_page.php without using the include function, it would generate an error (as expected) because there would be PHP tags wrapped in PHP tags:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>Killerphp.com Video Tutorial</title>
    </head>
    <body>
        <h1>PHP INCLUDES</h1>
        <p>
            <?php

//The line of code below would cause a parse error because PHP tags can’t be contained within PHP tags. Yet if I were to place this SAME line of code into an include file (whether that be footer.inc.php, footer.inc or even just footer.txt) and use the include function, no error would be generated and "fish" would be printed to the source. How come?
                <?php $secret_password = "fish"; ?>
                print $secret_password;
            ?>

        </p>
    </body>
</html>

Clearly, there's something fundamental about includes that I’m not getting.

5

(6 replies, posted in HTML/XHTML)

falkencreative wrote:

...The thing is, it really isn't realistic to consider building sites using HTML5 until all the major browsers support it...

Seems logical to me. Yet, there are quite a few sites that have decided to go where no site has gone before, some of which are showcased in this gallery. Then again, who can blame their developers for preferring the simple elegance of

<!DOCTYPE html>

over the convoluted

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

and similar document type declarations that only nerds could love!