Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 10:55 am EST

Geeklog Forums

php in staticpages causes errors


Status: offline

Limynali

Forum User
Chatty
Registered: 01/07/03
Posts: 39
I'm experiencing some problems using php in staticpages. I'm using the latest version (1.3.9). It works fine on my windows xp machine. But when I try the same thing on my redhat 9 w/ apache webserver I get this lovely error:

Parse error: parse error in /var/www/sweetgeek/plugins/staticpages/functions.inc(475) : eval()'d code on line 1

I get this error in any of my staticpages when I enable php whether or not they even have any php code actually in them. So I'm a bit confused as to why the same steps on one setup work fine but not for the other.

Thanks!
Got root?
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
Have you also the same static pages php settings on both machines?
(execute PHP, execute PHP with return)

geKow
 Quote

Status: offline

Limynali

Forum User
Chatty
Registered: 01/07/03
Posts: 39
yes, I've tried it with both return and execute on both machines. Again, it works fine on the one, and spits back that error on the other.
Got root?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
It really sounds like a syntax error or something similar in your PHP code.

Try it with some trivially simple code, like
Text Formatted Code
return "Hello, world";
 


Activating PHP when the page doesn't contain any PHP code doesn't make sense and will surely lead to a parse error.

bye, Dirk
 Quote

Status: offline

Limynali

Forum User
Chatty
Registered: 01/07/03
Posts: 39
Ok, thanks Dirk! I found out that a) you get lovely errors when no php code is there and b) I was a bit careless copying my static page content and lost the opening ?>.
Got root?
 Quote

Vadertech

Anonymous
I am getting the same error. echo hello world works.

My simple php code.

Text Formatted Code
<?php
include ('http://www.isdp.net/files/frontbanner.htm');
?>
 


If i put this same code into test.php, it works fine.
 Quote

Status: offline

Peter_Apockotos

Forum User
Junior
Registered: 03/18/04
Posts: 29
Remove the php tag, it is not needed.
 Quote

vadertech

Anonymous
Quote by Peter_Apockotos: Remove the php tag, it is not needed.


nice, thanks. I wonder why the mouseovers don't work through staticpages. Doe's staticpages restrict this?
 Quote

Status: offline

Peter_Apockotos

Forum User
Junior
Registered: 03/18/04
Posts: 29
I am not sure, do you have a page to look at?
 Quote

Status: offline

tmarquez

Forum User
Regular Poster
Registered: 06/17/03
Posts: 70
Note sure if this will help anyone, but I was having the same problem when I upgraded to 1.3.9sr1 with my php static pages.

I took out and everything started working fine.
T.Marquez Jr. -
Webmaster -
www.indianapolisfilm.net - Geeklog 1.4.0sr5-1
 Quote

MrB

Anonymous
worried
I followed the instructions for enabling php as I wanted to be able to call the Mr Rat Amazon script into a static page (available from www.absolute-freebies.com).

I went into groups and enabled the staticpages php as included in the documentation. I included the code as is (following the instructions in the Mr Rat manual) to test it before customising:

include_once("http://www.XXXXnet/cgi-bin/apf_feed.cgi? mode=videogames&node=471280");

I set execute (return).

I clicked on the page - and I received an error message telling me that my MySQL database wasn't there. I checked in through cpanel and found that all my databases (6 in all) were not there, and I could not log in to phpmyadmin .

Not sure if this is a geeklog, APF or hosting issue - fortunately my host was understanding and has reinstated my databases from backup , but I thought I would raise this in case it is a bug in the static page plug-in.

Kind regards

Mr B

 Quote

Status: offline

tgc

Forum User
Regular Poster
Registered: 03/15/06
Posts: 82
I want to php include a bit of code in my staticpages but I don't get it too work. I always get

Text Formatted Code
Parse error: parse error, unexpected '<' in /home/x/xxx.com/gl/plugins/staticpages/functions.inc(762) : eval()'d code on line 4


I used the

Text Formatted Code
return "Hello, world";
Dirk gave here a while ago.
I activated execute PHP for staticpages and I tried with execute PHP (returen) and execute PHP.
I am using GL 1.4.1.

Thanks for any ideas.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hello,

Did you try a simple
Text Formatted Code
echo "Hello, world";


::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

tgc

Forum User
Regular Poster
Registered: 03/15/06
Posts: 82
I get the same error message.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Do you have <?PHP ... ?> surrounding your PHP code? Because it isn't needed.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

tgc

Forum User
Regular Poster
Registered: 03/15/06
Posts: 82
I put it in just how I pasted it in the code box. No PHP tags.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Very strange because if you removed the PHP tags, there wouldn't be any '<' sign left to complain about...

Could it be a browser cache issue?

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EST. The time is now 10:55 am.

  • 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