If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Is there a way to parse PHP code in guestbook templates?  XML
Forum Index » Support Forum
Author Message
Anonymous



Hi

I find that I need to parse some PHP code inside one of the templates, but although variables seem to work fine, it will consider anything within <?php ?> tags as comments, as though it had an .html extension or something. I had a look at what the actual php file looked like and I can see why it does this (because it's being stuck in during the parsing and of course the page is parsed once), but is there any way around this?

Thanks

-Oli (cyben@phreaker.net)
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

by giving a file the .php extension you are telling the server to pass it to the PHP processor before sending it to the browser. The processor then looks for anything between <?php and ?>. The templates in the guestbook are turned into strings by the guestbook and so the templates are never sent to the processor. To put some php into the templates you will have to do the PHP in the script and have th results turned into a variable which you can then place in the template.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Anonymous



if you need to parse php to have it output in the page, you can put it in the main three files. index.php, addentry.php and comment.php.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Didn't I just say that?

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

yeah, but in non-tech speak lol

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Pah.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Carbonize wrote:Pah.


HAHAHAAHA!

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum