Help with server side .cgi script

Discussion in 'Software' started by beenie, Dec 30, 2006.

  1. beenie

    beenie Private E-2

    I have been learnning PERL and CGI from "PERL and CGI for the world wide web second edition" written by Elizabeth Castro. I am having no trouble understanding and writing the programs and getting them to exicute. I want to get some forms to work on my server and am having a lot of trouble finding the correct line of code to get them to exicute on my server. I am putting the following code in my public_html folder. I call it testform.html
    *****************************************************
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>test form</title>
    </head>
    <body>
    <form action="http://www.merlwebdesigns.com/cgi-bin/testform.cgi" method="POST">

    First Name <input type="text" name="first" size="12" maxlength="12" /><br />
    Last Name <input type="text" name="last" size="12" maxlength="12" /><br />
    <input type="submit" name="name" value="submit button" />
    </form>
    </body>
    </html>
    ****************************************************
    and the following code in my cgi-bin folder. I call it testform.cgi
    *******************************************************
    #!/usr/bin/perl

    my $first;
    my $last;
    $first = param('first');
    $last = param('last');


    print "Content-type:text/html\n\n";
    print "First name is $first<br />";
    print "Last name is $last<br />";
    print "Thank you for submitting your name to me";
    ******************************************************
    My server notes that the path to perl is: usr/bin/perl

    I think it's my action statement that is not correct. Can anyone get me the proper line of code to use in my action statement in testform.html to make my .cgi script exicute?
    Thanks in advance,
    Beenie
     
  2. chrisranjana.com

    chrisranjana.com Private E-2

    What is the error message you get ?
    Hopefully you have set 755 permissions on the.cgi script
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds