• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Parse error in insert_php.php

jtc

New member
Messages
4
Likes
0
Points
1
#1
Hi
I get the following parse error from this site
Elite spillere

Parse error: syntax error, unexpected ‘<' in /customers/3/e/a/sebbergolf.dk/httpd.www/wp-content/plugins/insert-php/insert_php.php(89) : eval()'d code on line 1

Some weeks ago there was no problem so is it an update that caused the problem?

Best Regards
Jesper
 

jtc

New member
Messages
4
Likes
0
Points
1
#3
This is the code:

PHP:
[insert_php]
$FileLocation = "/php/elitespiller.php";
include($_SERVER['DOCUMENT_ROOT'].$FileLocation);
[/insert_php]
 

Kirill

Support team
Messages
82
Likes
4
Points
8
#6
It looks like the editor inserts <br> tags inside the php block. Please check that you are editing in text / html mode.

We also added an alternative method based on a snippet. It is more safe. It is recommended to create a snippet and transfer your code to it.

1. Click in menu PHP snippets -> Add snippet
2. Type any name, put code and save:
Code:
$FileLocation = "/php/elitespiller.php";
include($_SERVER['DOCUMENT_ROOT'].$FileLocation);
3. Go to PHP snippets -> Snippets. The shortcode is displayed in the list to the right of the snippet name. Example: [wbcr_php_snippet id="xx"]
4. Insert the shortcode into the post.

Best regards
 

jtc

New member
Messages
4
Likes
0
Points
1
#7
Thank you, it seems to work with the snippet's but how come the other method don't work anymore?
 

Kirill

Support team
Messages
82
Likes
4
Points
8
#8
The old way only works in text / html mode. If you have saved a post with an active visual mode, problems may occur.

Best regards