Guest_imported
New member
- Jan 1, 1970
- 0
Help please!!
I have two serious problems with a script I am trying to write. I am going nuts trying to figure out what's wrong.
I have written a script to take form information and parse it to be sent to an email address. The script also checks the e-mail address and phone # for validity. If the input fails the test the HTML code is regenerated with the failed input in red.
Problem #1:
When I test the script the inputted information is not being reentered into the form. Instead, if you check the source for the newly generated page you see the inputted information in the title bar. I use the HTML POST method on both scripts. Here is a sample line:
print "<TR><TD WIDTH=105><B>First Name: </B></TD><TD><INPUT TYPE=\"TEXT\" NAME=\"first\" VALUE=\"$first\" SIZE=40 MAXSIZE=60></TD></TR>\n";
The second problem is that the e-mail checking routine always fails. Here is the routine (first I replace the ASCII values with the original @ or .):
$email = $formdata{'E-mail'};
$email =~ s/%40/@/g;
$email =~ s/%2/./g;
@check_email = split (//, $email);
foreach $letter (@check_email) {
if ($letter eq "@"
{
$good_email = 1;
last;
}
else {$good_email=0}
}
if (!$good_email | !$good_phone_number) {
reprint page .....}
Please help!!! I have almost gone bezerk trying to figure out whatI have done wrong here.
Thanks
I have two serious problems with a script I am trying to write. I am going nuts trying to figure out what's wrong.
I have written a script to take form information and parse it to be sent to an email address. The script also checks the e-mail address and phone # for validity. If the input fails the test the HTML code is regenerated with the failed input in red.
Problem #1:
When I test the script the inputted information is not being reentered into the form. Instead, if you check the source for the newly generated page you see the inputted information in the title bar. I use the HTML POST method on both scripts. Here is a sample line:
print "<TR><TD WIDTH=105><B>First Name: </B></TD><TD><INPUT TYPE=\"TEXT\" NAME=\"first\" VALUE=\"$first\" SIZE=40 MAXSIZE=60></TD></TR>\n";
The second problem is that the e-mail checking routine always fails. Here is the routine (first I replace the ASCII values with the original @ or .):
$email = $formdata{'E-mail'};
$email =~ s/%40/@/g;
$email =~ s/%2/./g;
@check_email = split (//, $email);
foreach $letter (@check_email) {
if ($letter eq "@"
$good_email = 1;
last;
}
else {$good_email=0}
}
if (!$good_email | !$good_phone_number) {
reprint page .....}
Please help!!! I have almost gone bezerk trying to figure out whatI have done wrong here.
Thanks