18.191.171.235 |    

Navigation

Google Advertisement

Get the form data from QueryString.

querystring
  1. #!/bin/bash
  2. # *********************************************************
  3. # file: querystring.sh
  4. # date: 18.10.2004
  5. # author: (c) by Marko Schulz - <mschulz@jamba.net>
  6. # description: Get the form data from QueryString.
  7. # *********************************************************
  8. # example of script call:
  9. # http://www.doman.de/cgi-bin/querystring.sh?src=xxx&target=yyy
  10.  
  11. # Scanning the QUERY_STRING and save the values/pairs
  12. # as elements in the array "QUERYSTRING".
  13. declare -a QUERYSTRING=( $( env | grep 'QUERY_STRING' | sed 's/QUERY_STRING=//g' | sed 's/&/ /g' ) )
  14.  
  15. # Loop the array "QUERYSTRING" and save each
  16. # form name as variable with its value.
  17. for element in ${QUERYSTRING[@]}; do
  18. 	name=$( echo $element|cut -d= -f1 )
  19. 	value=$( echo $element|cut -d= -f2 )
  20. 	eval $name=\'$value\'
  21. done
  22.  
  23. # Dumb HTML-Header.
  24. echo -en "Content-Type: text/html\n\n"
  25.  
  26. # Dumb Variables.
  27. echo "Source: ${src}"
  28. echo "Target: ${target}"
  29.  
  30. # *********************************************************
  31. # end of this script...
Parsed in 0.003 seconds at 370.70 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)