Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scripts [2009/01/01 10:12]
LtWorf the trunk version doesn't use the weird and non standard scripting anymore
scripts [2009/09/21 11:35] (current)
LtWorf
Line 1: Line 1:
-Support to scripts was weird and non standard. And the following is valid for old tagged version. +The latest version uses [[cgi]]. 
-The version in trunk uses [[cgi]]. +It you just need to install php5-cgi and it will work.
- +
- +
-====== Old versions ====== +
- +
-By default, weborf will try to execute .php and .bsh files and send the output to the client. +
-For .php files it will try to run **php** binary, giving to it the script to execute. +
-It will use **bash** to execute .bsh files. +
-Scripts are dangerous. If a script enters an infinite loop, one weborf's thread will wait its termination forever! +
- +
-===== GET ===== +
-GET fields can be retrieved using the commandline. +
- +
-==== PHP example ==== +
-<code php> +
-<? +
-echo "Parametri: ".$_SERVER['argc']."\n"; +
-echo "Parametro 0: $argv[1]\n"; +
-?> +
-</code> +
- +
-==== Bash example ==== +
-<code bash> +
-echo $1 +
-</code> +
- +
-**WARNING**: All the GET fields will be in the 1st parameter. This behavior will be changed. +
- +
-===== POST ===== +
-Http fields such as referrer or browser used are passed to the script using enviromental vars. And POST fields too. +
- +
-Bash example +
-<code bash> +
-#!/bin/bash +
- +
-echo "<html><body>" +
-echo "<form method=post action=post.bsh><input type=text name=nome /><input type=submit></form>" +
-echo "$nome" +
-echo "</body></html>" +
-</code>+
scripts.txt · Last modified: 2009/09/21 11:35 by LtWorf
 
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki