Jump to content
xisto Community
Sign in to follow this  
natalia.shvan

Little Help Regarding Cgi....

Recommended Posts

Hello all,, I keep getting the error message :"Can't find string terminator "END_HTML" anywhere before EOF at upload.cgi line 53" and I am at my wits end trying to fix this one. :P

Here is the script - if anyone has any suggestions post them at me, I'll try just about anything right now. Thanks :)

#!/usr/bin/perl -wTuse strict;use CGI;use CGI::Carp qw ( fatalsToBrowser );use File::Basename;$CGI:OST_MAX = 1024 * 5000;my $safe_filename_characters = "a-zA-Z0-9_.-";my $upload_dir = "http://forums.xisto.com/no_longer_exists/ $query = new CGI;my $name = $query->param("name");my $location = $query->param("location");my $email = $query->param("email");my $photolocation = $query->param("photolocation");my $filename = $query->param("uploadfile");if ( !$filename ){print $query->header ( );print "There was a problem uploading your photo (try a smallerfile).";exit;}my ( $name, $path, $extension ) = fileparse ( $filename, '\..*' );$filename = $name . $extension;$filename =~ tr/ /_/;$filename =~ s/[^$safe_filename_characters]//g;if ( $filename =~ /^([$safe_filename_characters]+)$/ ){$filename = $1;}else{die "Filename contains invalid characters";}my $upload_filehandle = $query->upload("uploadfile");open ( UPLOADFILE, ">$upload_dir/$filename" ) or die "$!";binmode UPLOADFILE;while ( <$upload_filehandle> ){print UPLOADFILE;}close UPLOADFILE;print $query->header ( );print <<END_HTML;<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Thanks!</title></head><body><p>Thanks for uploading your photo!</p><p>Your email address: $email</p><p>Your photo:</p><p><img src="http://forums.xisto.com/no_longer_exists/; border="0"></p></body>END_HTML;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.