Forum Index >  glFusion >  glFusion Support New Topic Post Reply
 Static Page query
   |  Printable Version
By: bisdak (offline)  Mar 13 2012 13:36 pm (Read 755 times)  
bisdak

I want to add the following line to some staticpages

PHP Formatted Code
<?php require_once ('count.php'); ?>



instead this is being converted to:

PHP Formatted Code
<!-- ?php require_once ('count.php'); ? -->



which of course will not be recognized by the php parser as a line of code.

Is there no way round this.

Thanks

Tita T
------
ex University of San Carlos Cebu | Sta Tomas Manila
Proudly Visayan now living in Europe
------


Forum Active Member
Active Member

Group Comfort
Level:
: +6

Registered: 08/14/09
Posts: 344
Location: Shrewsbury UK

Profile      
  Quote
By: bisdak (offline)  Mar 13 2012 18:19 pm  
bisdak

Before posting my query I had read the other forum posts regarding php in static pages none of the advice helped or solved the query I had, hence my posting.

I have found a workaround which seems to work whether it is the right solution I do not know.

I set up an autotag with the name counter and was able to put

PHP Formatted Code
[counter:%0%]

as the first line in the static page it does seem to work which is suppose all I can ask - if there is a better solution please post so I can implement it.

Thanks

Tita T
------
ex University of San Carlos Cebu | Sta Tomas Manila
Proudly Visayan now living in Europe
------


Forum Active Member
Active Member


Group Comfort
Level:
: +6

Registered: 08/14/09
Posts: 344
Location: Shrewsbury UK

Profile      
  Quote
By: lgarner (offline)  Mar 13 2012 20:32 pm  
lgarner

As I recall, when "execute PHP" is on in a static page it is all treated as PHP. I think you need to close the PHP tag, or omit the opening tag if PHP is your first item. For instance:

PHP Formatted Code
?> Some non-php text
goes here.
<?php echo $counter;?>
Some more text, now to re-open PHP at the end
<?php

Forum Admin
Admin

Group Comfort
Level:
: +52

Registered: 06/10/08
Posts: 1920

Profile Email Website  
  Quote
By: bisdak (offline)  Mar 13 2012 21:55 pm  
bisdak

Thanks Lee will give it a try as

PHP Formatted Code
require_once '../count.php'; ?>



as the first item on the first line and see how it goes.


Tita T
------
ex University of San Carlos Cebu | Sta Tomas Manila
Proudly Visayan now living in Europe
------


Forum Active Member
Active Member

Group Comfort
Level:
: +6

Registered: 08/14/09
Posts: 344
Location: Shrewsbury UK

Profile      
  Quote
By: bisdak (offline)  Mar 13 2012 22:02 pm  
bisdak

Lee it prints the line on screen could it be something to do with Advanced Editor and that is changing the syntax of the line. it is putting a "<p>" in front of the line and the same behind.

It is even wrapping the Autotag I put in but does seem to work, do you think I would be better keep that as a Q&D fix for the problem.

Thanks

Tita T
------
ex University of San Carlos Cebu | Sta Tomas Manila
Proudly Visayan now living in Europe
------


Forum Active Member
Active Member

Group Comfort
Level:
: +6

Registered: 08/14/09
Posts: 344
Location: Shrewsbury UK

Profile      
  Quote
By: Mark (offline)  Mar 13 2012 22:04 pm  
Mark

You can't use the advanced editor to embed PHP code. The advanced editor is designed to take what you type and display it, so it will translate <? to &gt;?. You must use the text HTML editor when you want to embed PHP code into a static page.

Thanks!
Mark

Forum Admin
Admin

Group Comfort
Level:
: +111

Registered: 10/21/05
Posts: 6348
Location: The Great State of
Texas

Profile      
  Quote
By: bisdak (offline)  Mar 13 2012 22:11 pm  
bisdak

That answers that so I best stick with my Q&D autotag fix as it seems to work - win some lose some.

Thanks Mark

Tita T
------
ex University of San Carlos Cebu | Sta Tomas Manila
Proudly Visayan now living in Europe
------


Forum Active Member
Active Member

Group Comfort
Level:
: +6

Registered: 08/14/09
Posts: 344
Location: Shrewsbury UK

Profile      
  Quote
New Topic Post Reply


 All times are CST. The time is now 02:55 pm.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic w/ New Post Sticky Topic w/ New Post
Locked Topic w/ New Post Locked Topic w/ New Post
View Anonymous Posts 
Able to Post 
HTML Allowed 
Censored Content