changeset 11245:d4f697a0ce8e octave-forge

(none)
author abarth93
date Mon, 19 Nov 2012 20:52:20 +0000
parents 7a4d00ef25a8
children 2c957dfa0d81
files extra/cgi/example/test_cgi.sh extra/cgi/example/test_cgi_post.m extra/cgi/example/test_cgi_post.sh
diffstat 3 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/cgi/example/test_cgi.sh	Mon Nov 19 20:52:20 2012 +0000
@@ -0,0 +1,8 @@
+DOCUMENT_ROOT=/var/www QUERY_STRING="x=50%2C1,2&y=1,2,3&len=10&name=test&field=random_field" octave <<EOF
+addpath('/home/abarth/Octave/octave-forge/extra/cgi/inst/');
+
+CGI = cgi()
+cgi.form.y
+
+
+EOF
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/cgi/example/test_cgi_post.m	Mon Nov 19 20:52:20 2012 +0000
@@ -0,0 +1,12 @@
+#!/usr/local/bin/octave -qH
+
+
+%addpath('/home/abarth/Octave/octave-forge/extra/cgi/inst/');
+addpath('/home/abarth/Octave/cgi/');
+
+CGI = cgi();
+CGI.form.y
+
+%AA = fscanf(stdin,'%s',54)
+%whos AA
+%[AA,count] = scanf('%c',10)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/cgi/example/test_cgi_post.sh	Mon Nov 19 20:52:20 2012 +0000
@@ -0,0 +1,6 @@
+export DOCUMENT_ROOT=/var/www 
+export REQUEST_METHOD=POST 
+export CONTENT_TYPE=application/x-www-form-urlencoded
+export CONTENT_LENGTH=54
+
+echo "x=50%2C1,2&y=1,2,3&len=10&name=test&field=random_field" | ./test_cgi_post.m