|
You type in a user name that is valid and it does else. Ideas as to what is happening?
if ($user =~ /^[-a-zA-Z0-9 ]+$/ )
{$user = $1;}
else
{print qq!<span style="color: rgb(255, 0, 0);">You can only have letters, spaces, and - on user name</span>\n!;
signup;
exit;}
|
|
|
add brackets unless you put brackets, perl will not remember the regex matched.. and thus $1 is not assigned...
i guess.. its not going to the else part.. try this..
if ($user =~ /^([-a-zA-Z0-9 ]+)$/ )
if it still goes to the else part.. let us know..
thanks and regards,
Shishir
|
|
|
Thanks for the shot at it; it still threw me to else... perhaps I am making an error earlier on that makes $user nothing?
#!/usr/bin/perl -wT
use strict;
# Load cgi routines
use CGI qw/:standard/;
# Set up my error reporting
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
# Denial of service protection
$CGI::POST_MAX=1024 * 100;
$CGI::DISABLE_UPLOADS = 1;
# Set to use file locking routine
use Fcntl qw(:flock :seek);
# Throw out the header
print "Content-type:text/html\n\n";
# Pre-Declare my subs
sub signup;
sub ReleaseLock;
sub GetLock;
# Parse the acolyte way...
my $user=param('user');
if ($user =~ /^([-a-zA-Z0-9 ]+)$/ )
{$user = $1;}
else
{print qq!<span style="color: rgb(255, 0, 0);">You can only have letters, spaces, and - on user name $user</span>\n!;
signup;
exit;}
Sub signup is pretty long...ran it through html tidy and checked for case
on user...
|
|
|
{print qq!<span style="color: rgb(255, 0, 0);">You can only have letters, spaces, and - on user name $user</span>\n!;
$user doesnt show anything on my screen...
|
|
|
I am ashamed I wasted your time on this one. I found my mistake in the html... the image jpg was coded as a href and not a submit button. I appreciate your help and I will try harder.
|
|
|
|
|
|
|
|