39 users online (0 members and 39 guests)  

Thread: need help


  Results 1 to 2 of 2
  1. #1
    n_d's Avatar
    New User

    Status
    Offline
    Join Date
    May 2009
    Posts
    1

    Thumbs down need help

    i wrote this code
    can i know why it's not working
    and what i should add

    Code:
    
    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    
    $err = "";
    
    if ($IN{'first'}) {
    
    if ($IN{'name'} eq '') {
    	&error;
    }else {
    	&doit;
    	}
    }
    
    print <<test;
    
    <html >
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>test</title>
    </head>
    <body>
    $err
    <form name=first method="POST" action="logs.pl">
    	<p>
    	<input type="text" name="name"  value="$IN{'name'}">
    	<input type="submit" value="sumbit" name="send">
    	<input type="reset" value="reset" name="reset"></p>
    </form>
    </body>
    </html>
    test
    exit 0;
    
    sub error {
    $err = "please enter a nick name" ;
    
    }
    
    sub doit {
    open (FH,">$IN{'name'}.txt");
    flock (FH,2);
    close (FH);
    
    print <<test;
    <p>$IN{'name'} is add </P>
    test
    }

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: need help

    The simple answer to your question is no, I cannot tell you why it isn't working. If you want anyone to help you, you need to tell us what the code does.