Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 02:53 pm EDT

Geeklog Forums

PHP tags are not working inside static pages


Status: offline

sharmisesha

Forum User
Newbie
Registered: 09/10/13
Posts: 7
Dear all,

Am using geeklog 2.0.0 version for project. I have created static pages with PHP tags. But php tags are not executed. I have enabled staticpages.php option for static page admin group. And php enabled for static pages.

Kindly suggest.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Did you also switch the "PHP" option to actually execute the PHP (with or without the return, depending on your code), as explained in the documentation?

What happens now? Does it display the code or do you get an empty page?

bye, Dirk
 Quote

Status: offline

sharmisesha

Forum User
Newbie
Registered: 09/10/13
Posts: 7
I have followed the steps given in the document. Am getting empty page.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
An empty page may be an indication of a problem in your PHP code. Debugging PHP code in a static page is a bit of a pain, unfortunately.

Try something simple first, maybe an echo statement, to confirm that it works at all and then slowly add parts of your code. Keep in mind that your PHP code will run as part of a function, so global variables need to be declared as such.

bye, Dirk
 Quote

Status: offline

sharmisesha

Forum User
Newbie
Registered: 09/10/13
Posts: 7
I have created a static page with simple echo statement. But it was not worked
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Did you enable the staticpage.php permission?

I would also make sure you use the post mode "HTML Formatted"

Tom
One of the Geeklog Core Developers.
 Quote

Status: offline

sharmisesha

Forum User
Newbie
Registered: 09/10/13
Posts: 7
in HTML formatted? Am not able to get your point. Can you explain me in detail. So that i can check it correctly.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
On the staticpage editor there is an option called "Post Mode". It is right above the content area. Make sure that is set to "HTML Formatted".

Tom
One of the Geeklog Core Developers.
 Quote

Status: offline

sharmisesha

Forum User
Newbie
Registered: 09/10/13
Posts: 7
There is no option called "Post Mode" in static page editor. Do i need to enable any plugin for that?
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Then you should be fine since you don't have the advance editor enabled.

It must be another issue. Did you follow Dirk's link and follow the instructions there?

ie enabled the permission right etc???
One of the Geeklog Core Developers.
 Quote

Status: offline

sharmisesha

Forum User
Newbie
Registered: 09/10/13
Posts: 7
PHP tags are working. But am not able to include PHP file using header() function. Pls suggest
 Quote

All times are EDT. The time is now 02:53 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content