Problem parsing PHP tag or front.func.inc.php?

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
kpimichael
Posts: 44
Joined: Mon 29. Dec 2003, 03:29

Problem parsing PHP tag or front.func.inc.php?

Post by kpimichael »

I upgraded to the new version 05/08. Now for some reason my external php code will not execute. I checked to make sure the security patches were applied. They were. My php code is outside the phpwcms path. I have it fully qualified as such:

Code: Select all

{PHP:/home/where/public_html/s2/my_external.php}
my path to phpwcms is:

Code: Select all

/home/where/public_html/phpwcms
when i add the tag to a page, nothing happens, no errors, nothing.

I compared the latest version with what i have on site and they both match so the code is uploaded correctly.

So it looks like there is a parsing problem for the {PHP} tag

I went back to the phpwcms_1.1-RC4_2004-05 and my php code works fine.

Is anyone else having a problem with this?

Thanks, Michael
Last edited by kpimichael on Tue 18. May 2004, 12:35, edited 2 times in total.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

i find this too :(
more importantly does anyone ave this WORKING? then we'll know if is our fault ;)
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

http://cvs.sourceforge.net/viewcvs.py/p ... ortby=date
CVS log for phpwcms/phpwcms_v1/include/inc_front/front.func.inc.php
Revision 1.3 - (download), view (text) (markup) (annotate) - [select for diffs]
Fri May 7 23:16:31 2004 UTC (10 days, 11 hours ago) by slackero
Changes since 1.2: +33 -6 lines
Diff to previous 1.2
security problem solved (I hope) - there was a possible injection via form field in frontend where remote files could be included without any check. Now all {PHP...} replacement tags are removed when forms are posted. And it's only possible to include files located in own web root.
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

It's no parsing error. It checks against the correct path. And path of included php file and phpwcms installation has to be equal.

There are 2 possible workarounds:

1) Include a correct php script that includes your "old" php script too.
2) place your php script into a secured subdir that's not readable from outside by using .htaccess/.htpasswd

I had to implement this for security reasons.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
kpimichael
Posts: 44
Joined: Mon 29. Dec 2003, 03:29

Thanks DeXXus

Post by kpimichael »

Looks like i need to learn to read. I moved code inside the root for phpwcms and all is well with the world again. Thanks for taking the time to respond.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

understanding that i am a total spanner... does this all mean I must have myfile.php in my phpwcms root dir for it to work? this is not working for me,
myfile.php is only...

Code: Select all

<?
echo "php include test";
?>
but I get nada :(

any step by step hotwto would be very marmly welcome :)
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

false ;-)

Code: Select all

<?php
include('/path/to/myfile.php'); 
?>
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

Hi O,

in my article I use..

Code: Select all

{PHP:phpmyinclude.php}
then in my phpwcms root dir I create a file..

Code: Select all

<?PHP
echo "I am here";
include ('/include/inc_ext/myscripts/myfile.php');
?>
I get nothing, no echo and no include :?

so i am a spanner for sure :(
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

pSouper wrote:I get nothing, no echo and no include :?
Hmmm, the echo should work fine... but you probably need to change the include path to have the "leading period of relativity" (-not- Leaning Tower of Pisa... pay attention pSouper) ;-)

Code: Select all

<?PHP 
echo "I am here"; 
include ('./include/inc_ext/myscripts/myfile.php'); 
?>
pSouper wrote:so i am a spanner for sure :(
Only if you think I meant "Leaning Tower of Pisa" ...up above :lol:
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

nada :( with or without the ./ (now i am 'leaning towards pizza' for sure :D
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

I did it like this (in an article and in the template):

Code: Select all

{PHP:phpmyinclude.php}
In "root" of phpWCMS, I created "phpmyinclude.php"

Code: Select all

<?PHP 
echo "I am here"; 
include ('./scripts/test_form.inc.php'); 
?>
In subfolder "scripts" (subfolder of "root" of phpWCMS), I created "test_form.inc.php" (Oliver's sample form element):

Code: Select all

<hr> 
<strong>Post-Test</strong> 
<?php if(!$_POST["count_submit"]) { ?> 
<form action="<?php echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'] ?>" method="post" name="myposttest" id="myposttest"> 
counter&nbsp;<input name="counter" type="text" id="counter">&nbsp;<input name="count_submit" type="submit" id="submit" value="send"> 
</form> 
<?php } else { ?> 
your counter value: <?php echo $_POST["counter"] ?><br> 
<a href="<?php echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'] ?>">fill in again</a><?php } ?> 
<hr>
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

Thanks D,
no joy.
but I know the problem is not my code :)
I will through a new set of files over the top and see what happens :fingers +'d: What no icon for that :? :D
Locked