X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=install%2F5.005%2FDBD-Pg-1.22-fixvercmp%2Feg%2FApacheDBI.pl;fp=install%2F5.005%2FDBD-Pg-1.22-fixvercmp%2Feg%2FApacheDBI.pl;h=b084f70f58abcad700b903d39208886909c03cf8;hp=0000000000000000000000000000000000000000;hb=ee146c3eada3bdb419ba471dd6df5e889d7dd7e5;hpb=c29fa7acc16efcc86af06077e739fca8b783c3c1 diff --git a/install/5.005/DBD-Pg-1.22-fixvercmp/eg/ApacheDBI.pl b/install/5.005/DBD-Pg-1.22-fixvercmp/eg/ApacheDBI.pl new file mode 100755 index 000000000..b084f70f5 --- /dev/null +++ b/install/5.005/DBD-Pg-1.22-fixvercmp/eg/ApacheDBI.pl @@ -0,0 +1,70 @@ +#!/usr/local/bin/perl + +# $Id: ApacheDBI.pl,v 1.1 2004-04-29 09:21:28 ivan Exp $ + +# don't forget to create in postgres the user who is running +# the httpd, eg 'createuser nobody' ! +# +# demo script, tested with: +# - PostgreSQL-7.1.1 +# - apache_1.3.12 +# - mod_perl-1.23 +# - perl5.6.0 +# - DBI-1.14 + +use CGI; +use DBI; +use strict; + +my $query = new CGI; + +print $query->header, + $query->start_html(-title=>'A Simple Example'), + $query->startform, + "
Enter the data source: | ", + "", $query->textfield(-name=>'data_source', -size=>40, -default=>'dbi:Pg:dbname=template1'), " | ", + "
Enter the user name: | ", + "", $query->textfield(-name=>'username'), " | ", + "
Enter the password: | ", + "", $query->textfield(-name=>'auth'), " | ", + "
Enter the select command: | ", + "", $query->textfield(-name=>'cmd', -size=>40), " | ", + "
", + "
", join(" | ", @$ary_ref), " |
\n"; + $sth->finish; + } else { + print "