Uli
Junior Member
Member # 3759
Rate Member
|
posted August 28, 2006 04:29 PM
The problem: I am able to connect to the SQL database using perl in a standalone program. I am able to send in and return the userid and pin from the perl program written in Perl. The problem comes when I put the database access and the vxml code together as below.
The error: ERROR error.badfetch.http.502: 'http://myserver/SQL.pl: Bad Gateway Error Error in CGI Application CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers.
The code: #!/usr/bin/perl -w
use strict; use CGI; use DBI;
my $q = new CGI; my $userid = $q->param('CustomerNum');
$dbHandle = (DBI->connect('DBI:ODBC:****', '*************', '*************'));
$sql = "SELECT ClientID from tblContact where BicId = 123"; $statementHandle = $dbHandle->prepare( $sql );
$statementHandle->execute() || die $statementHandle->errstr;
$arrayRef = $statementHandle->fetchrow_array();
$statementHandle->disconnect();
my $Pin = $arrayRef;
$statementHandle->finish(); $dbHandle->disconnect();
print "Content-Type: text/xml\n\n"; print "<?xml version=\"1.0\"?>\n"; print "<vxml version=\"2.0\" xmlns=\"http://www.w3.org/2001/vxml\">\n";
print "<f.orm>\n"; print "<var name=\"CustomerNum\"/>\n"; print "<var name=\"CustomerPin\"/>\n"; print "<block>\n";
print "Thank you! We are working on your perl request.\n";
print "<assign name=\"CustomerPin\" expr=\"<%=$Pin%>\"/>\n";
print "<assign name=\"CustomerNum\" expr=\"<%=$userid%>\"/>\n"; print "Test\n"; print "<return namelist=\"CustomerNum CustomerPin\"/>\n"; #print "<return/>\n"; print "</block>\n"; print "</f.orm>\n"; print "</vxml>\n"; print "\n";
exit 0;
Thank you for any help with this problem.
Posts: 1 | From: Texas | Registered: Aug 2006
| IP: Logged
|