Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: Connecting to Oracle DB using DBI from CGI script

by sierpinski (Chaplain)
on Jul 05, 2010 at 12:13 UTC ( #848051=note: print w/replies, xml ) Need Help??

in reply to Re^2: Connecting to Oracle DB using DBI from CGI script
in thread Connecting to Oracle DB using DBI from CGI script

The first thing I always check when CLI works but web doesn't, is that I have my Content-Type line correct.
You need two newlines after it:
print "Content-Type: text/html\n\n";
At least about 60% of the time for me, that fixes my main issue of not seeing anything, or rendering the page as text rather than html.
Definitely check out marto's links, those are nice tutorials.

Replies are listed 'Best First'.
Re^4: Connecting to Oracle DB using DBI from CGI script
by Anonymous Monk on Jul 06, 2010 at 07:33 UTC
    The below is a piece of code what we have in the environment
    #!/usr/bin/perl use DBI; use Date::Manip; #use String::Substrings; use Fcntl; #The Module $ENV{'ORACLE_HOME'}="/u01/app/oracle/product/10.2.0/client_1"; $ENV{'LD_LIBRARY_PATH'}="/u01/app/oracle/product/10.2.0/client_1/lib"; print "content-type: text/html \n\n"; print "<font face=verdana size=3><b>Netcool : Historical Report Versio +n 2.0</b></font><hr size=1 noshade color=white>"; ##-----------database connection #################### $dbh = DBI->connect('dbi:Oracle:orcl','username','password', { RaiseEr +ror => 1, AutoCommit => 0 }) or die "\n----------Unable for connect t +o server $DBI::errstr\n";
    I am using https protocol for accessing the url Please suggest any modification to be done.

    20100706 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://848051]
[holli]: is there anybody out there?
[shmem]: the world is full of people - out there...
[holli]: are you sure? or are they mere prjections of my hallucinating mind?
shmem feels uneasy over his guess of the tune for silent night, perl 6 night

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2017-09-22 20:49 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (269 votes). Check out past polls.