PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: hauptman at icst dot ml dot com (Skye Hauptman)
Subject: Hi All
Date: Dec 5 1995 3:31PM

Hi 

I am encountering a bizarre problem and I was hoping someone out there would 
know a workaround (if you're in the New York City area, drinks are on me, if 
you're not come into town and we'll do the same)

I am integrating sybperl with a web/cgi script and it runs fine on the command 
line, but dies with 'ERROR 500, malformed header'. I call &dbuse and &dblogin 
prior to printing the cgi header, and I think the problem rest in the system 
call (or maybe how my sybperl is situated in the web directory (it is included 
in the server root path)

many drinks are waiting to anyone who can help with this prob!

thanks
skye

(I inclose my script, it may help some out there both in thier work and in mine
please don't mind the comments, there the result of about 3 days of unfruitful 
and probably incompentent debugging!)

********************************************************************************
********************************************************************************
****************************************

!/home/hauptman/sybperl

require 'sybdb.ph';
require '/home/hauptman/web/cgi-bin/SYBASE_ADMIN_SUBROUTINES';
require '/home/hauptman/web/cgi-bin/CGI_SUBROUTINES';
#require '/home/hauptman/web/cgi-bin/CONTEXT_SUBROUTINES';

$|=1;
&parseWeb;
&parsePathInfo;

$customername = $in{"customername"};
$customerid = $in{"customerid"};
$user = "webadmin";
$password = "adminweb";



#$dbproc = &dblogin ($user,$password);

#&dbuse("$database");
#print ("before");
#print $ENV{CONTENT_LENGTH};
#print ("after");
#open (DUMP, ">>/home/hauptman/tmp.log") || die "cannot open dump file";
#read (stdin, $user, $password, $ENV{CONTENT_LENGTH});
#print(DUMP "$user\n");
#print(DUMP "stdin\n");
#print(DUMP "$ENV{CONTENT_LENGTH}");
#$title = "Client Access Web Administration";
#&Header



	
print("Content-type: text/html\n\n");


print('');
print('');
print(' Client Access Web Administration');      
print('');
print('');

print('
Database Administration2
'); print('
'); print $customername; print $PATH-TRANSALATED; print $CONTENT_LENGTH; print('
'); print $customerid; $query = "select * from clients"; &dbcmd($dbproc, sprintf("$query")); $s = &dbstrcpy($dbproc); print $s; if(! ($status = &dbsqlexec($dbproc))) { print("n14 Unable to execute query\n"); exit -1; } while (&dbresults($dbproc) ==1) { $PRE = "
";
		#printf("%10s", $PRE);
		while (@data = &dbnextrow($dbproc))
			{
			printf("%-40.40s %-40.40s \n",$data[0],$data[1]);
			}
		}
			
print('
'); print(''); print('');