38 users online (2 members and 36 guests)  


  Results 1 to 2 of 2

Related

  1. Script Returns HTTP Error 405    Forum: CGI Perl Forum
    Replies: 4
  2. Wondering why this script gets a 500 error    Forum: CGI Perl Forum
    Replies: 5
  3. Web-edit Script Error    Forum: PHP Forum
    Replies: 5
  4. Perl script error..    Forum: CGI Perl Forum
    Replies: 1
  5. PHP Upload script error    Forum: PHP Forum
    Replies: 14
  1. #1
    madan9999's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    2

    Premature end of script headers error

    hi all,
    i am getting the error "Premature end of script headers" when ever i include use Win32::ODBC.
    i need to connect to database...
    my code is as below..
    #! /usr/bin/perl

    push(@INC,"/cgi-bin");
    require("cgi-lib.pl");
    require("CGI.pm");

    $query=new CGI;
    print &PrintHeader;
    print $query->start_html;
    print $query->startform("get","/cgi-bin/data.cgi");

    use Win32::ODBC;

    $dbh= new Win32::ODBC("dsn=madan; uid=madan; pwd=madan");

    print "<input type=text name=dsn value=$dsn><br>";
    print "<center>The List of Tables That are specified in the DataBase you Entered are:<br>";

    if(!$dbh)
    {
    print "failure in connecting ".Win32::ODBC::Error();
    exit();
    }
    else
    {
    print "Connection Sucessful<br>";
    }
    $dbh->Connection();

    foreach $Temp ($dbh->TableList())
    {
    $Table = $Temp;
    print "<option value=$Table>$Table";
    }
    print "</select><br><br>";
    print "<br><br><input type=submit value=Submit>";
    print $query->endform;
    print $query->end_html

    thanks in advance
    madan chowdary

  2. #2
    cdlvj's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2006
    Posts
    2

    Re: Premature end of script headers error

    Quote Originally Posted by madan9999
    hi all,
    i am getting the error "Premature end of script headers" when ever i include use Win32::ODBC.
    i need to connect to database...
    my code is as below..
    #! /usr/bin/perl

    push(@INC,"/cgi-bin");
    require("cgi-lib.pl");
    require("CGI.pm");

    $query=new CGI;
    print &PrintHeader;
    print $query->start_html;
    print $query->startform("get","/cgi-bin/data.cgi");

    use Win32::ODBC;

    $dbh= new Win32::ODBC("dsn=madan; uid=madan; pwd=madan");

    print "<input type=text name=dsn value=$dsn><br>";
    print "<center>The List of Tables That are specified in the DataBase you Entered are:<br>";

    if(!$dbh)
    {
    print "failure in connecting ".Win32::ODBC::Error();
    exit();
    }
    else
    {
    print "Connection Sucessful<br>";
    }
    $dbh->Connection();

    foreach $Temp ($dbh->TableList())
    {
    $Table = $Temp;
    print "<option value=$Table>$Table";
    }
    print "</select><br><br>";
    print "<br><br><input type=submit value=Submit>";
    print $query->endform;
    print $query->end_html

    thanks in advance
    madan chowdary
    Win32::ODBC is not loaded or cannot be found in the perl search path.



Tags for this Thread