I'm looking for a simple template type program that will do the following...
A template page like this for example
<html>
<body bla bla bla>
<b>$variable1</b>
joe smoe went to the $variable2 and bought some $variable3
</body>
</html>
A form like this
<form method=post action="update.php">
<input type=text name="variable1" value="<?php echo $variable1;>">
I wont write the rest, you get the point. So the form input would replace the variables in the template file and write a new file. Seems simple to do but I can't figure it out. I'm kinda new to this stuff. Thanks for any help anyone can give!
PHP TEMPLATE SYSTEM WITH SIMPLE TAGS AND FORM
Moderator: General Moderators
Take a look at PEAR classes
http://pear.php.net
http://pear.php.net
PEAR has got 2 of the best Template-Engines.
Look at http://pear.php.net/package-info.php?pacid=108 for the Template IT. It's very smart and easy. Just variables are inserted with {...}, not $...
And if it is to simple for you, Flexy (http://pear.php.net/package-info.php?pacid=111), which is more powerfull.
Hope i could help you!
Regards,
Toby
Look at http://pear.php.net/package-info.php?pacid=108 for the Template IT. It's very smart and easy. Just variables are inserted with {...}, not $...
And if it is to simple for you, Flexy (http://pear.php.net/package-info.php?pacid=111), which is more powerfull.
Hope i could help you!
Regards,
Toby
Or...
... if you just want a thing, that replaces "$var"-like tags inside a template, use the ereg_replace() (see: function http://www.php.net/manual/en/function.ereg-replace.php ).
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
There's also preg_replace().
For more info on regular expressions: http://www.php.net/manual/en/ref.pcre.php
Mac
For more info on regular expressions: http://www.php.net/manual/en/ref.pcre.php
Mac