whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch master updated: Add example for query string processing
Date Wed, 19 Jun 2019 19:23:09 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d49409  Add example for query string processing
3d49409 is described below

commit 3d49409a0406aed9504cbf50c41e891350a5f0d0
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Wed Jun 19 11:54:29 2019 -0400

    Add example for query string processing
---
 www/test/example.cgi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/www/test/example.cgi b/www/test/example.cgi
index 3080245..b77324c 100755
--- a/www/test/example.cgi
+++ b/www/test/example.cgi
@@ -177,6 +177,16 @@ _html do
         end
       end
       
+      # IF YOU WANT TO DO WORK BASED ON ?QUERY=value
+      query = CGI::parse(ENV['QUERY_STRING'])
+      if query.has_key?('value')
+        _p "Query Value Passed: #{query['value']}" # Will be array
+      else
+        val = Array(query['query']).last
+        _p "Value Query Passed: #{query['query']}"
+        _p query.inspect
+      end
+      
       # IF YOU WANT TO DISPLAY A FORM and handle the POST
       _div id: 'example-form'
       if _.post?


Mime
View raw message