PDA

View Full Version : Newbie Needs Help With Subroutine


i-0
10-21-2005, 04:07 AM
The following is code that requires a user to key in a user name. How do I add an additional requirement for a user to enter an e-mail addy? To clarify, I need to require user name and e-mail to be entered before entrance.

Also, could I ask for some suggestions on a good beginners CGI book? I've been coding HTML and Javascript for a long while and have been a pretty good CGI "hack", but it's time to get real.

Thanks

#

$new_session = "no";
if ($session eq "") {
if ($channel_username eq "") {
if ($enter_channel eq "") {
&PrintChannelEntrance($setup,"");
} else {
&PrintChannelEntrance($setup,
"You must enter a username.");
}
exit;
}
$new_session = "yes";
$session = &MakeSessionFile($channel_username, $channel_email,
$channel_http, $refresh_rate,
$how_many_old, "0");
}

#

i-0
10-21-2005, 03:11 PM
#

$new_session = "no";
if ($session eq "") {
if ($channel_username eq "") {
if ($enter_channel eq "") {
&PrintChannelEntrance($setup,"");
} else {
&PrintChannelEntrance($setup,
"You must enter a username.");
}
exit;
}
# Begin Additional Code
if ($channel_email eq "") {
if ($enter_channel eq "") {
&PrintChannelEntrance($setup,"");
} else {
&PrintChannelEntrance($setup,
"You must enter a valid e-mail address.");
}
exit;
}
# End Additional Code
$new_session = "yes";
$session = &MakeSessionFile($channel_username, $channel_email,
$channel_http, $refresh_rate,
$how_many_old, "0");
}

#