rejetto forum

PHP in HFS

raybob · 6 · 10786

0 Members and 1 Guest are viewing this topic.

Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Made it possible!  It's not hard at all when you have a function to control command-line PHP and capture output  :)

See the template on the right and the resulting output in Mozilla on the left.

Unfortunately you have to use $args to pass variables into command line PHP, and running it like this clearly removes the possibility of running SMF or something.

Change "C:\program files\FHFS\php-bin\php.exe" in the script below to your correct PHP path, and place it under [request] in hfs.events.

Code: [Select]
{.set|php|{:{.if|{.exists|$1.php.}|{:{.exec|"C:\program files\FHFS\php-bin\php.exe" -n -f "C:\Program Files\FHFS\$1.php" $2|out=out.}:}|{:{.exec|"C:\program files\FHFS\php-bin\php.exe" -n -r "$1"|out=out.}:}.}{.^out.}:}.} {.comment| PHP FUNCTION $1 IS SCRIPT FILENAME OR DIRECT COMMANDS, $2 IS ARGUMENTS TO PASS IF SCRIPT FILE .}

« Last Edit: May 25, 2018, 05:23:01 PM by Mars »


Offline dccfoux

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
is this for an older version or something? Because I cannot seem to understand a thing you are talking about  :-\
I would love some help on this.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
most things published on this board (programmers corner) won't be understandable by those who are not programmers.

he is suggesting a way to interface programmatically with HFS.
it's not exactly a fast method, but it may be enough for some purposes.


Offline dccfoux

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
most things published on this board (programmers corner) won't be understandable by those who are not programmers.

he is suggesting a way to interface programmatically with HFS.
it's not exactly a fast method, but it may be enough for some purposes.
thats what I thought. I wanted to host like a forum from it(backup my site).


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
you cannot run a php forum with this solution


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Rejetto is right.  That won't be possible until PHP is implemented directly into HFS.  This method is only for simple PHP commands or in-line scripts.  Each command takes roughly 0.07 seconds, so loading up a page with tons of php commands will make a very slow page.  What you can do with this is very limited, but it still opens up a few possibilities.  

That being said, if you were to take the time to reprogram a PHP script to use just argument variables in place of URL Variables, posted variables, and cookies, then it could theoretically be possible, but not practical.
« Last Edit: April 17, 2012, 02:51:32 PM by raybob »