Zen Cart Logo
Forums / General Questions / HTMLAREA problems with entering <?php code

HTMLAREA problems with entering <?php code

Locked

Views: 1,515

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
7 Feb 2009, 10:13 AM
#1
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

HTMLAREA problems with entering <?php code

I've tested the possibility of writing PHP code in a page (for example the main-page) with HTMLAREA (clicking the "<>" icon), and I've seen that is going well.
For example the code
<br>
SESSION['language'] = <?php echo $_SESSION['language']; ?>
<br>
show in the main-page
SESSION['language'] = english

The problem is that if I open again the main-page for making some change, (alwais clicking the "<>" icon) the code appear changed, and not good.

Have somebody an idea for how to avoid this?
Thanks - Giovanni

7 Feb 2009, 2:54 PM
#2
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

Nobody......?
Thats what happen to the original code:

<br /> SESSION['language'] = <!--p echo $_SESSION['language'];--> <br />
7 Feb 2009, 3:00 PM
#3
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

I don't think HTMLArea can handle PHP code block . that might be the reason that code block changes when you reopen them in HTMLArea.

I can only suggest , using FCKeditor or TinyMCE . you can find both of them in free add on .

7 Feb 2009, 3:28 PM
#4
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

Many thanks, tony_sar.
I'll find FCKeditor and TinyMCE, hoping that there's a readme.txt for explainig how to install.
Thanks again - Giovanni

7 Feb 2009, 3:41 PM
#5
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

there is installation info , and by far , they seems to be the easiest modules to install :P

8 Feb 2009, 8:48 AM
#6
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

Well, I've installed the FCKeditor, and the problem is the same. Maybe that all the WYSIWYG editors are not good for the PHP tags.
So I've decided to work in this way:

  • I can prepare the layout of the page with HTMLarea or FCKeditor (even if I prefer always to write the code by myself).
  • Then I select the editor "Text only" to properly correct the code, and save.

I think this is the better thing to do.

Giovanni

8 Feb 2009, 10:11 AM
#7
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

open fckconfig.js in your fckeditor folder

around line 55 uncomment the like
FCKConfig.ProtectedSource.Add
just uncomment the one for php source protection ..

don't forget , you have to alway enter your php code in source view ..
after uncommenting .. FCKeditor will not damage your code block . :P

9 Feb 2009, 9:25 AM
#8
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

Many thanks, tony_sar.
That's o.k.
Giovanni

18 Sep 2009, 7:55 AM
#9
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

But now arise another problem:
while in the extra pages the php code is translated, in the product description this don't happen!!
Some suggestion????

Thanks - Giovanni

18 Sep 2009, 8:54 AM
#10
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

you can not add php code in product description .. same goes for EZpages .

18 Sep 2009, 9:42 AM
#11
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Re: HTMLAREA problems with entering <?php code

Thanks, tony_sar.