$WidthOfGraphic],expr],$maxmemory*1024*1024,\"Too Much RAM has been used so we are Aborting. This is currently limited to $maxmemory Mb in witm.php, but can be changed on the web server.\"],$maxtime,\"This is taking too long, so is being aborted. There is a limit of $maxtime seconds, which can only be changed by editing the PHP script on the web server - a user can't override this from their browser.\"]"); $handle = popen("echo $fullcmd | tee stdin.txt | $math | $sedcommand | tee stdout.txt", "r"); $data=fread($handle,10000); pclose($handle); } } /* The following is almost the same as the command above, but is modified a little for the mobile device. It prints smaller graphics and saves them to a different file name on mobile devices. */ if (isset($_POST['EvaluateMobile'])) { if ( $webserver === $demoURL) $data="Sorry, due to the license restrictions on Mathematica, I can't install a copy of that product here for all to use. So this demo of WITM on $demoSite does not function. If you installed WITM yourself, you would get text results in this text box and graphical ones, like the 3D graph, in the box below. I would appreciate feedback on WITM, even if you can only provide it from this demo."; else { $cmd=$_POST['input_data']; /* Undo the effect of the magic quote abomination */ if (get_magic_quotes_gpc()) { $cmd=stripslashes($cmd); } $fullcmd=escapeshellarg("TimeConstrained[MemoryConstrained[expr=$cmd;head=ToString[Head[expr]];If[head==ToString[Graphics] || head==ToString[SurfaceGraphics] || head==ToString[ContourGraphics] || head ==ToString[DensityGraphics] || head==ToString[GraphicsArray] || head==ToString[Graphics3D] ,Export[$handheld,expr,ImageSize->$WidthOfGraphicMobile],expr],$maxmemory*1024*1024,\"Too Much RAM has been used so we are Aborting. This is currently limited to $maxmemory Mb in witm.php, but can be changed on the web server.\"],$maxtime,\"This is taking too long, so is being aborted. There is a limit of $maxtime seconds, which can only be changed by editing the PHP script on the web server - a user can't override this from their browser.\"]"); $handle = popen("echo $fullcmd | tee stdin.txt | $math | $sedcommand | tee stdout.txt", "r"); $data=fread($handle,10000); pclose($handle); } } ?> PHP script for WITM - the Web Interface to Mathematica

PHP script for WITM (Web Interface to Mathematica)

WITM icon
WITM version $WITMversion, dated $WITMlongdate."; ?>
Copyright(C) 2006 Dr. David Kirkby PhD. Licensed under the GNU General Public License
&1", "r"); $str=fread($handle,200); $len=strlen($str); /* Test if we can read the version number (4.0, 4.1, 4.2, 5.0, 5.1, 5.2 or later) */ if($len === 0) // can't read version. echo "WITM ver $WITMversion.
WARNING: It would appear that WITM has not connected to Mathematica - this will always happen on http://witm.sourceforge.net/ since Mathematica is not installed on Sourceforge. But if this message appears when you expect WITM to connect to Mathematica, then there is a problem.
"; else // print version echo "
WITM ver $WITMversion. Mathematica ver $str
"; ?>
&1", "r"); $str=fread($handle,200); /* Test if we can read the version number (4.0, 4.1, 4.2, 5.0, 5.1, 5.2 or later) */ $len=strlen($str); if($len === 0) // Can't read version echo "
WARNING: It would appear that WITM has not connected to Mathematica - this will always happen on http://witm.sourceforge.net/ since Mathematica is not installed on Sourceforge. But if this message appears when you expect WITM to connect to Mathematica, then there is a problem.
"; else echo "
Mathematica: $str
"; ?>

Enter your Mathematica commands in the text box below. If you are not sure of the command, or a command's syntax, take a look at one of the following 4 links on the Wolfram Research web site:



"; ?>



"; ?>

Documentation

WITM's documentation can be read on the Sourceforge web site. The documentation should have also been installed locally. You really need to read the documentation, as some things behave differently from when using Mathematica's notebook interface.