Re: Can you recommend a good PHP includes tutorial?
| From: | Freedomware | Date: | Wed, 14 Jan 2004 13:16:50 +0000 |
| Subject: | Re: Can you recommend a good PHP includes tutorial? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174541@lists.php.net to get a copy of this message | ||
Wow, that is a lot simpler than I imagined. Thanks for the tip!
Jay Blanchard wrote:
[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!