perl, apaeche problem
Posted in 1999
Topics: Platform-Specific Issues
Thank all of you! I finally made DBI, DBD work with IDS on my Linux machine. However, the problem never ends. I wrote a small perl code with DBI. It generates right html format when I run it along. But I have difficulty to send html data back to browser. I have use SetEnv in httpd.conf for Informix variable. It does not seem give me help. Hope you can help the newbie again. Here is the code: #!/usr/bin/perl -w use DBI; use CGI; use CGI::Carp; # accept the CGI request my $q = new CGI; # send the HTTP header print $q->header(); # set <Title> and <BODY> print $q->start_html("Test Report"); # print big header print $q->h1("Account Information"); my $dbh = DBI->connect("dbi:Informix:test_db", "login_xx", "pw_xxx") || die "Can't connect to database - $DBI::errstr."; my $sth = $dbh->prepare ( q{select acct, name from f_cmast where name like 'BLOOM%'}) || die "Can't prepare statement: $DBI::errst"; my $rc = $sth->execute || die "Can't execute statement: $DBI::errst"; print "<p><table border>\\n"; print "<tr><th>Acct No</th><th>Name</th></tr>\\n"; while (($acct, $name) = $sth->fetchrow_array) { print "<tr><td>$acct</td><td>$name</td></tr>\\n"; } warn $DBI::errst if $DBI::err; $sth->finish; $dbh->disconnect; print "</table></p>"; print $q->end_html(); TIA Randy
"Randy Hao" <r_hao@hotmail.com> writes: > Thank all of you! > I finally made DBI, DBD work with IDS on my Linux machine. > However, the problem never ends. > > I wrote a small perl code with DBI. It generates right html format when I > run it along. > But I have difficulty to send html data back to browser. I have use SetEnv > in httpd.conf > for Informix variable. It does not seem give me help. > Hope you can help the newbie again. INFORMIXDIR and INFORMIXSERVER are set? Shure? does 'print $ENV{INFORMIXDIR};' produce output? > Here is the code: give us the error-messages instead! Check apaches errorlog if you don't see any Thomas
Thank you, Thomas. The problem was the SetEnv format wrong in httpd.conf Thomas Parsli <thomas.parsli@startsiden.no> wrote in message news:wkzovi27zp.fsf@startsiden.no... > > give us the error-messages instead! > Check apaches errorlog if you don't see any > > Thomas