Eagle_f91 has asked for the wisdom of the Perl Monks concerning the following question:
#!/user/bin/perl -w use strict; use CGI::Carp qq~fatalsToBrowser~; use CGI q~:standard~; use DBI; print "Contect-type: text/html\n\n"; my ($DBH, $STH, $Creator, $ContactMethod, $Contact, $FileName, $Game, +$Section, $Width, $Height, $File, $FileHandel, $Result, $Error); $Creator = param('Creator'); $ContactMethod = param('ContactMethod'); $Contact = param('Contact'); $FileName = param('FileName'); $Game = param('Game'); $Section = param('Section'); $Width = param('Width'); $Height = param('Height'); $File = param('File'); $File =~ s/.*[\/\\](.*)/$1/; $FileHandel = upload('File'); $Error = 0; mkdir ("e:/web/public_html/finalfantasyinfo/ffinfo/protected/images/av +atars/$Game"); mkdir ("e:/web/public_html/finalfantasyinfo/ffinfo/protected/images/av +atars/$Game/$Section"); $DBH = DBI -> connect ('dbi:ODBC:FFInfocom', '', '') or die "$DBI::err +str;"; $STH = $DBH -> prepare (qq~exec AddAvatars ?, \@Creator = '$Creator', +\@ContactMethod = '$ContactMethod', \@ContactAddress = '$Contact', \@ +AvatarName = '$FileName, \@Game = '$Game', \@Section = '$Section', \@ +Width = '$Width', \@Height = '$Height'~) or die "$DBI::errstr;"; $STH -> bind_param_inout(1, \$Error, 1); $STH -> execute or die "$DBI::errstr;"; if ($Error == 0) { open UPLOADFILE, ">e:/web/public_html/finalfantasyinfo/ffinfo/prot +ected/images/avatars/$Game/$Section/$File"; binmode UPLOADFILE; while (<$FileHandel>) { print UPLOADFILE; } close UPLOADFILE; $Result = 'New Avatar added'; } else { $Result = 'That Avatar already exists. Please add another one or c +hange the file name and try again.'; } &PrintHTML; sub PrintHTML { print qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN +" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Final Fantasy Info.com Site Administration Section</title> <meta name="description" content="Final Fantasy Info.com Site Administ +ration Section" />~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\ssi\header.txt +') or die 'Can not open e:\web\public_html\finalfantasyinfo\ffinfo\ss +i/header.txt'; print <FILE>; close FILE; print qq~</head> <body onload="columnheight(); highlight()"> <div style="text-align: center; margin-bottom: 2px"><img src="http://w +ww.ffinfo.com/images/misc/sitebanner.jpg" width="950" height="100" al +t="Welcome to Final Fantasy Info.com - The Best Place to Find Everyth +ing Final Fantasy!" /></div>~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\ssi\nav.txt') +or die 'Can not open e:\web\public_html\finalfantasyinfo\ffinfo\ssi\n +av.txt'; print <FILE>; close FILE; print qq~<div id="leftcolumn">~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\admin\menu.txt +') or die q~Can not open e:\web\public_html\finalfantasyinfo\ffinfo\a +dmin\menu.txt~; print <FILE>; close FILE; print qq~</div> <div id="maincolumn"><div class="sectioncontent">$Result</div> </div> <div id="copywrite">~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\ssi\copywrite. +txt') or die 'Can not open e:\web\public_html\finalfantasyinfo\ffinfo +\ssi\copywrite.txt'; print <FILE>; close FILE; print qq~</div> </body> </html>~; }
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ' +Test4'. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark + after the character string ''. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not +be prepared. (SQL-42000)(DBD: st_execute/SQLExecute err=-1); at e:\we +b\public_html\finalfantasyinfo\ffinfo\admin\avatars\addavatar.pl line + 25.
Content restored by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help debuging a script that uses commands I am just learning
by pc88mxer (Vicar) on Apr 07, 2008 at 02:15 UTC | |
|
Help debuging a script that uses commands I am just learning
by Gavin (Archbishop) on Apr 06, 2008 at 21:21 UTC | |
|
Re: Help debuging a script that uses commands I am just learning
by starbolin (Hermit) on Apr 07, 2008 at 18:30 UTC |