summaryrefslogtreecommitdiff
path: root/submit.php
diff options
context:
space:
mode:
authorSanmugasundaram2013-07-31 17:07:41 +0530
committerSanmugasundaram2013-07-31 17:07:41 +0530
commit935f52cea62dabb46b6b8fc86446231316fccfdd (patch)
tree43de5bb453a956cc88c5f402f27c246588926542 /submit.php
downloadscilab_cloud_interface-935f52cea62dabb46b6b8fc86446231316fccfdd.tar.gz
scilab_cloud_interface-935f52cea62dabb46b6b8fc86446231316fccfdd.tar.bz2
scilab_cloud_interface-935f52cea62dabb46b6b8fc86446231316fccfdd.zip
31-07-2013 initial commit
Diffstat (limited to 'submit.php')
-rwxr-xr-xsubmit.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/submit.php b/submit.php
new file mode 100755
index 0000000..8dc4923
--- /dev/null
+++ b/submit.php
@@ -0,0 +1,32 @@
+<?php
+
+$ch = curl_init();
+$code = $_POST['code'];
+$graphics=($_POST['graphicsmode']);
+
+$fields = array (
+ "graphicsmode" => urlencode($graphics),
+ "scilab_code" => urlencode($code),
+ "api_user" => "scilab",
+ "externaluser" => urlencode("3"),
+ "api_key" => urlencode("zdFmTjX98.")
+ );
+$fields_string='';
+foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
+rtrim($fields_string, '&');
+$url="http://scilab-test.garudaindia.in/cloud/scilab_evaluate";
+//set the url, number of POST vars, POST data
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch,CURLOPT_URL, $url);
+curl_setopt($ch,CURLOPT_POST, count($fields));
+curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
+//execute post
+$result = curl_exec($ch);
+echo $result;
+//$json_d = json_decode($result);
+//close connection
+#$show = $json_d->{'output'};
+//curl_close($ch);
+//echo $show;
+
+?>