Hi
 
My notes below are pseudo code, but it should get you get you started in 
the right direction.  If you don't want to display the login window, you 
have to check for it before you output the form.

Perl Perl wrote:
>
> Dear All,
>        I am new to Perl CGI and few querries regarding formating and 
> dispaying the output message. I have written below script and the 
> problem I am facing with this script is as below.
> 1) At the start of the script the (before enterring the user name and 
> password ), it shows the message "*You have not enterred some field" 
> ,* (this is the print statement I used to check user has enter the 
> data or not.).
> 2) I want the out put to be displayed line by line like username in 
> first line and passwrd in second line ( we can hide the password with 
> ****)
> 3) When I run the script it shows the* output along with the login 
> window*. I don't want to display the login window, only I want to see 
> the output message.
>     we can do one thing, if password or user id is wrong, then we can 
> prompt for login window by saying enterred information is wrong.
>  
> Please help to overcome this issue.
> ** 
> #!/usr/local/bin/perl -w
   use strict;  # always a good idea.

 use CGI::Carp qw(fatalsToBrowser);   # a good idea while you're debugging a 
cgi script. 
                                      #It will show you perl errors in the 
browser.


> use CGI;
> my $q = new CGI;
>
> print $q -> header,
>     $q -> start_html(),
>
##### Check for your parameters here. If the parameters exist, then it 
must be the second time the page has been run. (Do your checks.)
##### If the parameters don't exist, then show your form.
if ($q->param) {
  ## parameters exist, do checks for valid username and password.
}
else
{
   # just show the form.
}
>
>     $q -> start_form(),
> $q->table
> (
>   $q -> Tr
>   ( [
>    $q ->td(['Enter User Name :',
>      $q -> textfield ( -name => 'username',
>                           -size => '50'
>                       ) ] ),
> #print "Password",
>    $q ->td( ['Enter Password:',   
>       $q -> password_field( -name => 'pass',
>                               -size => '50',
>                          ) ] ),
>    ]),
> );
>
>       print $q-> submit();
>       print $q -> end_form();
>       #print $q -> end_html();
>

> #if( $q -> param("username") and $q -> param("pass"))
> #{ 
>  #   print $q -> param("username");
>
>   #  print $q -> param("pass");
> #}
> #else
> #{
>  #  print "You have not enterred some field \n";
> #}
>  #     #print $q -> end_form();
>

>       print $q -> end_html();
>
>  
>

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to