[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PHP and Octave
From: |
Andrew W. Schmeder |
Subject: |
Re: PHP and Octave |
Date: |
Thu, 23 Aug 2001 00:44:17 -0700 |
On Wednesday 22 August 2001 09:07, OOzy Pal wrote:
> I am not going to give the user a complete control.
> For example, the user will input only number and
> coefficients of a linear system and then my php code
> will interact with octave. Will this be ok?
All you need to do is use some regular expressions in the PHP which check to
make sure that the incoming variables conform to your expectations.
e.g. to make sure $num is a numeric value, strip all characters except 0-9,
"." and "-".
$num = preg_replace("/[^0-9\.-]/", "", $num);
I guess you could call your octave program from the command line and pass
args, or invoke the octave interpreter with popen().
-andy
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------