[Solve] Contact layout

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

[Solve] Contact layout

Post by gph »

Hi,

I have installed phpMyFaq 1.6.10 on Apache 2.0/MySql5/Php5.

When i try to use HTML code in "Contact information" they where printed without parse.
Exemple : <B>Scola Concept</B>
I want to write in bold.
In version 1.6.6 it work well (on other server).

The PHP code in records when i put <?PHP print "test"?> in text mode is not saved in database. How can i save it ?

And it was not parse when i'll put in in MySql directly.
What i may wrong ?
The config check "tpl engine arse PHP" is true.


I want it to PHP Code to list a directory filename in a records.

Regards, Philippe.
Last edited by gph on Thu Mar 15, 2007 12:44 pm, edited 1 time in total.
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

maybe the PHP function eval() is disabled on this server? We didn't changed something in this area between 1.6.6 and 1.6.10.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

Hi,

Thanks for the reply.

There is no disable function on the server.
I try eval function with a small script and it works well.

Did anyone have another idea ?

Bye bye.
Philippe.
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

how does the entry look like in the database?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

Hi,

For the first point :

In phpMyFaq Setup :
<B>Scola Concept</B><BR>
<BR>
ZI Toulon EST<BR>
130, rue Berthelot<BR>
BP401<BR>
83085 TOULON Cedex 9<BR>
Result :
<B>Scola Concept</B><BR> <BR> ZI Toulon EST<BR> 130, rue Berthelot<BR> BP401<BR> 83085 TOULON Cedex 9<BR>
In config.php :
// Informations de contact
$PMF_CONF["msgContactOwnText"] = "<B>Scola Concept</B><BR>
<BR>
ZI Toulon EST<BR>
130, rue Berthelot<BR>
BP401<BR>
83085 TOULON Cedex 9<BR>";
The version 1.6.6 run under PHP4 and my new server on PHP5.
I don't think i was the problem but it's for your information.
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

For the second point :

In edit records (HTML mode) :
Start

<?PHP print "test"?>

End
In MySql :
<p><strong>Start</strong></p><p>End</p><p><!--P print "test--><br /><!--P print "test--></p><p><!--P print "test--></p><!--P print "test-->

Result :
Start

End
In Edit record (source mode<>) :
<p><strong>Start</strong></p><?PHP print "test"?><p>end</p>

In MySql :
<p><strong>Start</strong></p><?PHP print "test"?><p>end</p>
Same result.

When i edit the record in source mode :
<p><strong>Start</strong></p><!--P print "test--><p>end</p>
Thanks for your help.
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

try <?php instead of <?PHP

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

Hi,

Same result except when edit recors it display back correctly the <?php ...
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

well, we have to debug this... do you have a debugger installed?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

Hi,

No !

It's run on a dedicated server.
Software insatalled :
Linux kernel 2.6.19-1
Fedora Core 5 up to date with yum (similar to apt-get)
PHP Version 5.1.6
MySql Ver 14.12 Distrib 5.0.27
Apache 2.2.2

Other phpr software (phpList, phpMyVisite and phpMyAdmin) are working well.

What do you want i do for debugging ?

Thanks a lot for your help.
Philippe
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Re: Contact layout

Post by matteo »

Hi Philippe,
gph wrote:I have installed phpMyFaq 1.6.10 on Apache 2.0/MySql5/Php5.

When i try to use HTML code in "Contact information" they where printed without parse.
Exemple : <B>Scola Concept</B>
I want to write in bold.
In version 1.6.6 it work well (on other server).
since PMF 1.6.7, also to reduce XSS injection, we've removed the possibility to parse plain HTML text in several config values when rendered.
If you want to relax this constraint on your Contact page, please locate, backup and open the [PATH_TO_PMF_INSTALL]/contact.php and moved the line below from:

Code: Select all

...
                        'msgContactOwnText' => htmlentities($PMF_CONF['msgContactOwnText']),
...
to:

Code: Select all

...
                        'msgContactOwnText' => $PMF_CONF['msgContactOwnText'],
...
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi Philippe,
gph wrote:In edit records (HTML mode) :
Start

<?PHP print "test"?>

End
I guess you've tuned your php.ini to avoid error printing. Please try with:

Code: Select all

<?php print "Test"; ?>
You need:
  1. to use <?php PHP_Working_Code_Here ?>: as Thorsten already said, only lower case is parsed;
  2. to write valid PHP code so in your example missing a ";" is bad ;)
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

Hi Matteo,

For the HTML code in contact :
it's OK :D
Thanks !

For php code :
Yes it's true.
In my forum reply i don't put the ; and my php config don't display errors.
But in my code when i try, i have the ; and it's the same result.

When i put php code in normal editing mode :

Code: Select all

Start


<?php print "test"; ?>

end
Blank line instead <?php ..> if i put php code in source mode <>

I'll got to change my php.ini to display error and i'll give you back the result.
I'll probalbly make a mistake but i don't see where ...

Bye bye
gph
Posts: 13
Joined: Thu Dec 22, 2005 6:11 pm

Post by gph »

Ok, parse is working :!:

For include php code we need to :
edit in source mode <>
use <?php

Code: Select all

 ?> in lowercase
save the record

if there is an error in code the code is not display.
If you want to log the errors don't forget to change owner to apache.apache to the log file of php.

[color=red]In case of editing record, go to source mode and replace <!-- [Code] --> by <?php [Code] ?>[/color]


I think i made some confuse when i made all my previous tests, probably many errors. 

When i restart for scratch and made my tests with method, it was good.

Thanks for your help and sorry for spending your time.

Philippe.



[/i]
Post Reply