87 users online (1 members and 86 guests)  

  Results 1 to 3 of 3


  1. making div    Forum: HTML Forum
    Replies: 1
  2. Need help making a search script    Forum: CGI Perl Forum
    Replies: 7
  3. Making an application    Forum: Website Scripts Forum
    Replies: 8
  4. Making gifs    Forum: HTML Forum
    Replies: 2
  5. Making changes    Forum: HTML Forum
    Replies: 6
  1. #1
    RageDNA's Avatar
    New User

    Join Date
    Sep 2003

    Hello, need help with a script I'm making

    Hello, need help with a script I'm making.

    I have setup this script and its working fine. Now I would like to take this basic script to
    a new level and have it save to a HTML page instead of just a text file.

    This is the basic CGI script for processing Web forms. The script will take the
    information from the Web forms and save it to a tab-delimited text file, responses.txt, in
    your public_html directory while printing a brief message to the Web browser.

    I would like to get this script to save the info from the web form to a HTML webpage
    rather then a simple text file.

    If someone could help me with this I would greatly appreciate it.

    Here is the basic script that I have so far.

    use CGI;
    $file = '../tutorial_files/responses.txt';
    print "Content-type:text/html\n\n";
    print '<HTML><HEAD><TITLE>saveform.cgi results</TITLE></HEAD>';
    print '<BODY BGCOLOR="FF0066">';
    print '<h2>Thank you for your form submission.</h2>';
    print '</BODY></HTML>';
    open(FILE, ">>$file")||die "Can't open $file";
    flock(FILE, 2)||die "Can't lock $file";
    foreach $i (keys %in) {
    print FILE "$in{$i}\t";
    print FILE "\n";
    close(FILE) || die "Can't close $file";


  2. #2
    QuietDean's Avatar

    Join Date
    Oct 2000
    Bournemouth, UK

    I am by no means an expert on Perl (in fact, I only know how to break it) but It looks like you have most of it above already. All that remains is to output your variables to the same page (and maybe change the filename to responses.html) and it should work fine.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    RageDNA's Avatar
    New User

    Join Date
    Sep 2003
    Thanks.. I'll play with it a bit see what I can come up with.

Tags for this Thread