F
froil
When i run this on my box it works fine. no errors, but when i upload
it to the server, it keeps giving me error 500 premature end of script.
i know that most likely it is some stupid little mistake, but i have
looked over this for hours and can't find it. Seems to complie and run
#!/usr/bin/perl
#newpage.cgi
use warnings;
use strict;
use DBI;
use CGI qwstandard);
use CGI::Carp qw(fatalsToBrowser);
my $username = '?';
my $password = '?';
my $data_source = 'DBI:mysql:jilesfr_pictures:69.6.255.192:3306';
Print_Html_Top();
Get_Descriptions();
Print_Html_Bottom();
sub Print_Row{
my $rec = shift;
my $currentpage = $rec->{currentpages};
print qq(<tr><td><input type=radio name=pagename
value=$currentpage>$currentpage</td></tr>);
}
sub Get_Descriptions{
my $DBH = DBI->connect( $data_source, $username, $password )
or die "Error: $DBI::errstr\n";
my $sth_fetch=
$DBH->prepare( qq(SELECT * FROM pages)) or die
$DBH->errstr;
$sth_fetch->execute();
while( my $ptr = $sth_fetch->fetchrow_hashref){
Print_Row($ptr);
}
}
sub Print_Html_Top{
print header;
print<<EOT;
<html><head><title>Add Files</title></head>
<body>
<Form name="upload" Method="Post"
Action="/cgi-bin/uploadeasy1.cgi" Enctype="multipart/form-data">
<center><h2>Add Pictures</h2></center>
<center><font size=3>Select page to add to, or type in
name of new page</font></center>
<center><Table Border=1>
<tr><td>New Page Name: </td>
<td><input type="text" name="newpage"></td></tr>
EOT
}
sub Print_Html_Bottom {
print<<EOT;
<tr>
<td>Choose File: </td>
<td><input type="file" Name="filename"></td>
</tr>
<tr>
<td>Description: </td>
<td><input type="text" Name="description" rows="1"
cols="40"></td></tr>
<tr><td><input type="submit" Name="submit" Value="Save
File"></td></tr></table></center>
</form>
</body></html>
EOT
}
it to the server, it keeps giving me error 500 premature end of script.
i know that most likely it is some stupid little mistake, but i have
looked over this for hours and can't find it. Seems to complie and run
#!/usr/bin/perl
#newpage.cgi
use warnings;
use strict;
use DBI;
use CGI qwstandard);
use CGI::Carp qw(fatalsToBrowser);
my $username = '?';
my $password = '?';
my $data_source = 'DBI:mysql:jilesfr_pictures:69.6.255.192:3306';
Print_Html_Top();
Get_Descriptions();
Print_Html_Bottom();
sub Print_Row{
my $rec = shift;
my $currentpage = $rec->{currentpages};
print qq(<tr><td><input type=radio name=pagename
value=$currentpage>$currentpage</td></tr>);
}
sub Get_Descriptions{
my $DBH = DBI->connect( $data_source, $username, $password )
or die "Error: $DBI::errstr\n";
my $sth_fetch=
$DBH->prepare( qq(SELECT * FROM pages)) or die
$DBH->errstr;
$sth_fetch->execute();
while( my $ptr = $sth_fetch->fetchrow_hashref){
Print_Row($ptr);
}
}
sub Print_Html_Top{
print header;
print<<EOT;
<html><head><title>Add Files</title></head>
<body>
<Form name="upload" Method="Post"
Action="/cgi-bin/uploadeasy1.cgi" Enctype="multipart/form-data">
<center><h2>Add Pictures</h2></center>
<center><font size=3>Select page to add to, or type in
name of new page</font></center>
<center><Table Border=1>
<tr><td>New Page Name: </td>
<td><input type="text" name="newpage"></td></tr>
EOT
}
sub Print_Html_Bottom {
print<<EOT;
<tr>
<td>Choose File: </td>
<td><input type="file" Name="filename"></td>
</tr>
<tr>
<td>Description: </td>
<td><input type="text" Name="description" rows="1"
cols="40"></td></tr>
<tr><td><input type="submit" Name="submit" Value="Save
File"></td></tr></table></center>
</form>
</body></html>
EOT
}