You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

  1. SkovdeHF
  2. JCE Editor
  3. Monday, 11 February 2019
Hello.

My JCE editor is replacing the <?php> code with <!--
I have checked the box to allow php code but still it does this.
Am I doing something wrong?


/Anders
Accepted Answer Pending Moderation
It is not possible to execute PHP code in a Joomla article without the help of a special extension, like Regular Labs Sourcerer - https://www.regularlabs.com/extensions/sourcerer

Please post a screenshot of the code you are attempting to add to the editor.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
  1. more than a month ago
  2. JCE Editor
  3. # 1
Accepted Answer Pending Moderation
I downloaded Sourcerer. Don't really understand how it works though.
the code I am trying to add is this one:


<?php

$xml = new SimpleXMLElement('http://handballstats.se/club/xml/22/table_2018_1800201.xml',0,true);


//eller


$xml = simplexml_load_file('http://handballstats.se/club/xml/22/table_2018_1800201.xml');

foreach($xml->team as $team) {


//läs av attribut


$attr = (string) $team['rank'];


//eller


$attr = "$team[rank]";


//läs av textinnehåll


$text = (string) $team->scoreplus;


//eller


$text = "{$team->scoreplus}";
?>
  1. more than a month ago
  2. JCE Editor
  3. # 2
Accepted Answer Pending Moderation
I downloaded Sourcerer. Don't really understand how it works though.


This is the only way you will be able to execute PHP code in your article.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
  1. more than a month ago
  2. JCE Editor
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!