Example of a Web application.

    HTML
    <HTML>
    <HEAD>
    <META HTTP-EQUIV=Content-Language CONTENT=ja>
    <META HTTP-EQUIV=Content-Type CONTENT='text/html; charset=UTF-8'>
    </HEAD>
    <BODY BGCOLOR=#DDDDDD>
    
    Database 
             <input type="text" name="PGDATABASE" length=32>
    Username 
             <input type="text" name="PGUSER2" length=32>
    Password 
             <input type="text" name="PGPASSWORD2" length=32>
    
    </BODY>
    </HTML>
    

    Web application (CGI)
    #!/usr/local/bin/pgbash
    ##########################################################################
    #  "select1.cgi"
    #
    #   $PGDATABASE   # database name
    #   $PGUSER2      # database user
    #   $PGPASSWORD2  # database password
    #  
    ##########################################################################
    exec 2>&1
    echo "Content-type:  text/html"
    echo ""
    set EXEC_SQL_OPTION CGI;
    
    #--------- start HTML ----------
    echo "<HTML>"
    echo "<HEAD>"
    echo "<META HTTP-EQUIV=Content-Language CONTENT=ja>"
    echo "<META HTTP-EQUIV=Content-Type CONTENT='text/html; charset=UTF-8'>"
    echo "</HEAD>"
    echo "<BODY BGCOLOR=#DDDDDD>"
    
    #-------- connect to DATABASE ---------
    connect to $PGDATABASE user $PGUSER2  $PGPASSWORD2;
    
    if(( SQLCODE != 0 )); then
       exit
    fi
    
    #---------- client_encoding -----------
    set client_encoding='UTF8';
    
    #------------ execute SQL -------------
    select * from member;
    
    if (( SQLCODE == 0 && SQLNTUPLE == 0 )); then
    echo "<H2>Data not found.</H2>"
    fi
    
    #------- disconnect DATABASE ----------
    disconnect all;
    
    echo "</BODY>"
    echo "</HTML>"
    

    Output
    useridnameemailtelkind ....
    1220XXXXXXXmmmmmmmm@nifty.ne.jp0726-76-9999*  
    1249XXXXXXmmmmmmm@email.ne.jp090-7103-9999*  
    1217XXXXmmmmmmmm@nifty.ne.jp042-571-9999NET  
    1221XXXXmmmmm@mbg.sphere.ne.jp0726-27-9999*  
    1250XXXXmmmmmmm@oct.zaq.ne.jp06-6622-9999*  
    1271XXXXXmmmmmmmm@nifty.ne.jp06-6872-9999*  
    1222XXXXmmmmmmmm@nifty.ne.jp0798-72-9999*  
    1212XXXXmmmmmm@sannet.ne.jp0725-20-9999*  
    1203XXXXmmmm@computer.com0742-40-9999*  
    1223XXXXmmmmmmmm@nifty.ne.jp0742-45-9999*