#!/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/avatars/$Game"); mkdir ("e:/web/public_html/finalfantasyinfo/ffinfo/protected/images/avatars/$Game/$Section"); $DBH = DBI -> connect ('dbi:ODBC:FFInfocom', '', '') or die "$DBI::errstr;"; $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/protected/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 change the file name and try again.'; } &PrintHTML; sub PrintHTML { print qq~ Final Fantasy Info.com Site Administration Section ~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\ssi\header.txt') or die 'Can not open e:\web\public_html\finalfantasyinfo\ffinfo\ssi/header.txt'; print ; close FILE; print qq~
Welcome to Final Fantasy Info.com - The Best Place to Find Everything Final Fantasy!
~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\ssi\nav.txt') or die 'Can not open e:\web\public_html\finalfantasyinfo\ffinfo\ssi\nav.txt'; print ; close FILE; print qq~
~; open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\admin\menu.txt') or die q~Can not open e:\web\public_html\finalfantasyinfo\ffinfo\admin\menu.txt~; print ; close FILE; print qq~
$Result
~; 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 ; close FILE; print qq~
~; } #### [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:\web\public_html\finalfantasyinfo\ffinfo\admin\avatars\addavatar.pl line 25.