Resubmitting information

I have script that posts information entered into a form on the screen in basic html. I need for the user to be able to look the info over and if they like it, they can hit save and it saves it as an html document. If they don't like it, the can return to the form page. Can someone help with this?
Who is Participating?
maneshrConnect With a Mentor Commented:
try this it should work


use CGI;

$query=new CGI;


print "Content-type: text/html\n\n";

if ($query->param){ ##  The form has been submitted by user
  if ($action=~ /^Submit Now\!\!$/){
    print "<P><B>Here is what you entered<P>\n";
    print "<B>First Name: </B>";
    print $fn,"<BR>";
    print "<B>Last Name: </B>";
    print $ln;
    print "<INPUT TYPE=HIDDEN NAME=fn VALUE=\"",$fn,"\">\n";
    print "<INPUT TYPE=HIDDEN NAME=ln VALUE=\"",$ln,"\">\n";
    print "<P><INPUT TYPE=SUBMIT NAME=action VALUE=\"Save Now!!\">\n";
    print "<INPUT TYPE=SUBMIT NAME=action VALUE=\"Re-Enter Now!!\">\n";
    print "</FORM>\n";
  }elsif ($action=~ /^Save Now\!\!$/){
    print "<B>Write code to save here!!</B>\n";

print "Enter First Name: <INPUT TYPE=TEXT NAME=fn VALUE=\"",$fn,"\"><P>\n";
print "Enter Last Name: <INPUT TYPE=TEXT NAME=ln VALUE=\"",$ln,"\">\n";
print "<P><INPUT TYPE=SUBMIT NAME=action VALUE=\"Submit Now!!\">\n";

print "</FORM>\n";
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.