RE: [PHP] Can you recommend a good PHP includes tutorial?
| From: | Jay Blanchard | Date: | Wed, 14 Jan 2004 12:57:59 +0000 |
| Subject: | RE: [PHP] Can you recommend a good PHP includes tutorial? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-174535@lists.php.net to get a copy of this message | ||
[snip]
I thought this would be the easiest thing to learn, but I'm striking out
right and left. I bought a book about PHP, but the includes examples
don't work for me at all. I searched several forums and www.php.net, but
it's hard to even zero in on a good tutorial.
[/snip]
http://www.php.net/include
There is no tutorial for this because it is painfully simple to use.
Create toBeIncluded.php --
<?php
$todayDate = date("m-d-Y");
?>
<h1>Today is <?php echo $todayDate; ?></h1>
You're all done!
Now create myIncluded.php --
<html>
<head></head>
<body>
<h1>Welcome!</h1>
<?php
inlclude("toBeIncluded.php");
?>
</body>
</html>
All done! Now just place these files in the same directory in your web
server and load myIncluded.php from the browser. You may have to pay
close attention to the paths of the files, but it is pretty simple
really.
HTH!