Search Members Help

» Welcome Guest
[ Log In :: Register ]

 

[ Track This Topic :: Email This Topic :: Print this topic ]

reply to topic new topic new poll
Topic: Utterly Stupid Question, Go easy, I'm a 'lam0r'...< Next Oldest | Next Newest >
 Post Number: 1
ShakerMaker Search for posts by this member.
Mad For It
Avatar



Group: Members
Posts: 103
Joined: Sep. 2001
PostIcon Posted on: May 27 2002,09:16  Skip to the next post in this topic. Ignore posts   QUOTE

Is there anyway of using say PHP to make a template file and use a line of code that inserts text into the html from a simple text file?  ??? If that makes any sense...

Edited by ShakerMaker on Jan. 01 1970,01:00
Offline
Top of Page Profile Contact Info 
 Post Number: 2
Beldurin Search for posts by this member.
Mayor of Detnet
Avatar



Group: Members
Posts: 1242
Joined: Aug. 2001
PostIcon Posted on: May 27 2002,19:41 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Quote (ShakerMaker @ 27 May 2002,03:16)
Is there anyway of using say PHP to make a template file and use a line of code that inserts text into the html from a simple text file?  ??? If that makes any sense...

write the template in html, name it .php and then where you want to insert the text use the following command

Code Sample

<?
include("$DOCUMENT_ROOT/path/filename");
?>


Easy as pie.

edit: made the code stand out

Edited by Beldurin on Jan. 01 1970,01:00

--------------
If someone's ungrateful and you tell him he's ungrateful, okay, you've called him a name.  You haven't solved anything.  -- zen and the art of motorcycle maintenance
Offline
Top of Page Profile Contact Info WEB 
 Post Number: 3
ShakerMaker Search for posts by this member.
Mad For It
Avatar



Group: Members
Posts: 103
Joined: Sep. 2001
PostIcon Posted on: May 28 2002,07:06 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Quote (Beldurin @ 27 May 2002,11:41)
Quote (ShakerMaker @ 27 May 2002,03:16)
Is there anyway of using say PHP to make a template file and use a line of code that inserts text into the html from a simple text file?  ??? If that makes any sense...

write the template in html, name it .php and then where you want to insert the text use the following command

<?
include("$DOCUMENT_ROOT/path/filename");
?>

Easy as pie.

Holy shit! To easy! Thanks heaps!

Shouldn't that read:

<?php
include("$DOCUMENT_ROOT/path/filename");
?>

?

Thanks a million!
Offline
Top of Page Profile Contact Info 
 Post Number: 4
ShakerMaker Search for posts by this member.
Mad For It
Avatar



Group: Members
Posts: 103
Joined: Sep. 2001
PostIcon Posted on: May 28 2002,07:27 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Woohoo! It worked!

It works with html as well. :D

Is there a way to do this with only using one template?
So that every html file is opened in that ONE template?

Like on some sites I see the link that ends with: file.php?=100

How do I do that?

Edited by ShakerMaker on Jan. 01 1970,01:00
Offline
Top of Page Profile Contact Info 
 Post Number: 5
Beldurin Search for posts by this member.
Mayor of Detnet
Avatar



Group: Members
Posts: 1242
Joined: Aug. 2001
PostIcon Posted on: May 29 2002,18:36 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

1.)  you don't need the "php" in the <? tags...it works fine w/out it

2.)  I actually do it backwards from what you're asking.  What I do is I put all "common" design and layout elements before the page content into a header file, and all the layout stuff after the page content into a footer file.  Then, each individual display file looks like this.
Code Sample

<?
include("/SSIdirectory/header.php");
?>

page content, page content, page content, page content,
page content, page content, page content, page content,
page content, page content, page content, page content,

<?
include("/SSIdirectory/footer.php");
?>


bam!  now any layout/logo/color/design changes are only made in 1 file, and are reflected througout the site.  The file.php=100 is simply passing an arguement to the script, you can do all sorts of stuff w/that.  If you want some examples of PHP and these kinds of things, email me at beldurin@packethell.com.  Hope that helps!

--------------
If someone's ungrateful and you tell him he's ungrateful, okay, you've called him a name.  You haven't solved anything.  -- zen and the art of motorcycle maintenance
Offline
Top of Page Profile Contact Info WEB 
 Post Number: 6
Wiley Search for posts by this member.
©0®ÞØ®4+3 whØ®3
Avatar



Group: Members
Posts: 1268
Joined: Oct. 2001
PostIcon Posted on: May 29 2002,20:43 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Beldurin,
You have now exceeded the maximum number of helpful answers that you are allowed to give in the geek forum.  The only thing you are allowed to say for the durration of this thread is  ...h4h4, j00 h4v3 n0 l33t pHp 5k1llz l1k3 m3,  h4h4h4 l4m0r!!   :p

--------------
There's a sucker born every minute ...but swallowers are hard to find.
Offline
Top of Page Profile Contact Info WEB 
 Post Number: 7
Beldurin Search for posts by this member.
Mayor of Detnet
Avatar



Group: Members
Posts: 1242
Joined: Aug. 2001
PostIcon Posted on: May 29 2002,21:24 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Quote (Wiley @ 29 May 2002,14:43)
Beldurin,
You have now exceeded the maximum number of helpful answers that you are allowed to give in the geek forum.  

rofl...I almost fell out of my chair!  :D

Quote
The only thing you are allowed to say for the durration of this thread is  ...h4h4, j00 h4v3 n0 l33t pHp 5k1llz l1k3 m3,  h4h4h4 l4m0r!!   :p


um...what he said.  :D

--------------
If someone's ungrateful and you tell him he's ungrateful, okay, you've called him a name.  You haven't solved anything.  -- zen and the art of motorcycle maintenance
Offline
Top of Page Profile Contact Info WEB 
 Post Number: 8
ShakerMaker Search for posts by this member.
Mad For It
Avatar



Group: Members
Posts: 103
Joined: Sep. 2001
PostIcon Posted on: May 30 2002,06:36 Skip to the previous post in this topic.  Ignore posts   QUOTE

Thanks again Beldurin.  thumbs-up.gif
Offline
Top of Page Profile Contact Info 
7 replies since May 27 2002,09:16 < Next Oldest | Next Newest >

[ Track This Topic :: Email This Topic :: Print this topic ]


 
reply to topic new topic new poll

» Quick Reply Utterly Stupid Question
iB Code Buttons
You are posting as:

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code