Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: david20000512

Message # 1025191:
Date: 04/17/05 17:55
By: JaseTaylor
Subject: PHP and HTML sorted

Ok, i've been looking at the articles wondering "o no. for my php code to work at all do i need to get some inside a template?" answer obviously no. Basically in either phplib or fasttemplate set ur {} tags in the array to a variable. eg {contents} => $contents

There we go, we have a variable waiting to receive data. now on each page you writing php for, do the template parsing AT THE END. write all your php for the page first and then parse the template at the end of the code. this way u can set $contents to say

$contents = 'this is a test';

And voila, it'll appear in the final product
Not hard hard guys. if ur bothered about copying and pasting code like a session or user check for every page I have a simple solution, rather than trying to fit the damn thing into the template, do an include at the start of each page. here's layout i use


<?php
//includes like sessions checks
//All script needed here like checking database etc
//define variable eg $content = from code above
?>

<?php
//Then the template parser
?>

job done

Previous Message | Next Message


Comments:
*傍楼! 咯己苞 榴扁绰 具茄 悼康惑*蜡府窍11/17/05 14:32
我是我我是我我是我我是我我是我我是我我是我我是我我是我11/17/05 07:11
how to install only template.inc into our dirsuresh08/11/05 02:07
PHP and HTML sortedJaseTaylor04/17/05 17:55
How to send variables from java to php?php_java01/19/05 06:40
墨/靛/倒妨阜扁肺/噶啊瘤脚盒/怖 焊技夸!捞驱柳11/26/04 04:59
脚.侩.阂.樊.磊/寸老500/措.免.厚.过捞锐柳11/19/04 00:44
墨/靛/倒妨阜扁肺/噶啊瘤脚盒/怖 焊技夸!捞沥楷11/16/04 18:42
措'免'芭'例'矫'100%登'霸'窍'绰'规'过茄版驱11/15/04 19:24
PHP/CGI Desktop Prog HelpBill09/19/03 22:17
RE: How to integrate WYSIWYG editors?Manny08/30/03 15:25
Hey David, what about blocks?Abraham08/07/03 08:08
RE: Do you have to INSTALL phplib??Strong07/21/03 01:20
RE: Turning off $variable substitutionfrodo03/14/03 17:51
RE: Variable passed to reset() is not an arraArmino02/12/03 06:40
RE: How to integrate WYSIWYG editors?Dan Jallits12/23/02 20:38
RE: Variable passed to reset() is not an array...alex08/31/02 11:16
RE: Variable passed to reset() is not an array...xxx08/31/02 11:02
creating new templateLobster08/12/02 17:31
RE: Turning off $variable substitutionJohn Branstad08/02/02 11:50
Variable passed to reset() is not an array...alex07/31/02 11:39
RE: Sending output to a fileJason07/25/02 19:15
RE: Do you have to INSTALL phplib??omer dogan07/22/02 19:01
How to integrate WYSIWYG editors?Clive Richardson07/16/02 04:30
RE: Is This the Front of the PHP Templating CurveSarah07/08/02 22:25
RE: My view on templates and PHPSarah07/08/02 21:56
RE: Do you have to INSTALL phplib??Sarah07/08/02 21:53
Do you have to INSTALL phplib??Robert07/06/02 14:44
Turning off $variable substitutionBert beckmann07/02/02 02:41
RE: set_block no workie for you?Goobernutz06/18/02 10:47
RE: 'Not a directory'Mike Julian06/02/02 16:18
'Not a directory'Mike Julian05/28/02 21:26
RE: My view on templates and PHPars05/24/02 17:27
Sending output to a fileElizabeth Sterling04/10/02 16:59
RE: Is This the Front of the PHP Templating CurveGlen Hassell04/10/02 08:04
Is This the Front of the PHP Templating CurveRafiki Cai03/22/02 14:06
My view on templates and PHPChristopher Brown-Floyd03/16/02 11:07
where is correct path with FastTemplate..morris03/12/02 13:02
RE: Templates - Can Include PHP Code?Reini Urban03/05/02 17:13
& variablesSalvino02/21/02 06:30
RE: Templates in Templatesmaniyan s.v.s01/22/02 06:00
An excellent tutorial (en francais)guibod01/07/02 06:20
RE: include (); PROBLEMS :-((E. Sterling12/19/01 11:20
variables in an includeE. Sterling12/19/01 10:05
RE: Templates in TemplatesE. Sterling12/19/01 09:59
RE: Are templates search engine friendly?Samuel L. Diaz12/13/01 21:52
RE: Are templates search engine friendly?High-Fish12/10/01 16:38
RE: Templates and MySQLJacques Morin12/10/01 14:42
not an ideal templeteing systemBrian Cavanagh12/08/01 22:43
Templates and MySQLCrystal Cope12/06/01 10:57
RE: Item-SubItem using nested blocksJi Tao11/06/01 08:52
Are templates search engine friendly?Samuel L. Diaz10/29/01 22:15
RE: has anyone made this workTim Hewitt10/20/01 15:34
RE: How is this different from FastTemplate?Scott J. Miles10/18/01 16:12
RE: Item-SubItem using nested blocksRory10/16/01 06:00
Multiple Template DirectoryPhil Smalley10/03/01 05:43
How is this different from FastTemplate?Matthew Weier O'Phinney10/02/01 08:57
include (); PROBLEMS :-((Nick09/13/01 16:03
Warning while using blocksRalph08/15/01 07:03
Item-SubItem using nested blocksEmil Malinov06/30/01 18:04
RE: set_block no workie for you?Sondra Russell06/01/01 09:35
RE: Next articleMiles Lightwood06/01/01 09:18
Templates in TemplatesSergey Petrov06/01/01 03:05
php and Oracle on windows 98William & Jhon05/28/01 12:10
has anyone made this workCayley05/23/01 16:01
Exact way to put php into a .ihtml templateEdward Stoops Jr.05/22/01 09:12
flash integrationUdi05/15/01 00:31
A question about phplib template variablesTim Myers05/01/01 23:35
RE: Javascript problemR Kurniawan04/26/01 01:16
RE: Templates - Can Include PHP Code?Marinne Chuang04/17/01 13:56
Next articleNightOwl04/03/01 07:38
RE: Templates - Can Include PHP Code?Chris Saylor03/21/01 15:00
Backslashes appearing before every "Adomas03/11/01 09:59
RE: Templates - Can Include PHP Code?Phil03/08/01 22:04
RE: Templates - Can Include PHP Code?Peter Manchester03/08/01 08:40
RE: set_block no workie for you?dan donaldson03/07/01 18:20
set_block no workie for you?Denny03/01/01 16:42
Templates, The PHPLIB WayBill Eddins02/14/01 09:32
RE: Problems with template directoryRussell Johnston02/09/01 06:52
RE: Problems with template directoryBillboe02/06/01 21:47
RE: Javascript problemNicole01/31/01 17:36
RE: Javascript problemNicole01/31/01 17:35
RE: Javascript problemFinnur01/25/01 08:33
Problems with template directorycybernd12/09/00 11:17
RE: Using PHPLIB TemplateLen12/06/00 06:59
Using PHPLIB TemplateCory12/01/00 17:20
RE: Javascript problemTolga Orhon11/17/00 12:03
RE: set_blockDavid10/27/00 19:02
RE: set_blockDaniele Dignani10/11/00 03:25
RE: Templates - Can Include PHP Code?David Lizano10/10/00 11:43
set_blockMico Nast10/06/00 06:26
RE: Javascript problemAlejandro V醩quez09/27/00 10:39
Javascript problemDenis Healy08/18/00 08:27
Templates - Can Include PHP Code?Ken M. Mevand07/13/00 09:02
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.