The thank you page that comes up... I want to make my own. I can manage that but I don't see where the url gets specified in the script.... (?)
It may not
be a URL. Sometimes it is, and if this is the case look for
print "Location:$url\n\n";
Or similar, look for "location." Which is really a bad way to do a thank you. Most often you will see a general process like
&cleanse_data;
&email_data;
&print_response;
Or, those may be "inline," executing from top to bottom. The advantage here is you can customize it, like
"Thank you for your submission, John Doe . . . . "
Whatever text appears on your thank you response, search your script for it, this will tell you where it is in this case.
what I see is ... print "Click here to <A HREF=$ENV{'REFERRER'}>Back</A>.\n";
This is your "thank you?" This tells me it's in the script, inline. This is really a lame and unfriendly approach. :-) And if your form is encapsulated in the script, it will indeed lead back to itself, or at best, the form if it's separate from the script.
Right where that line is, try this:
#print "Click here to <A HREF=$ENV{'REFERRER'}>Back</A>.\n";
print "this is my response";
Note the #, that is a comment and makes perl ignore that line. If that works and you see "this is my response," you can do this:
$response = qq|
<html><head><title>Thank You</title></head>
<body>
<h1>Thank You</h1>
<p>Thank you for your submission, $FORM{'first_name'}.</p>
</body>
</html>
|;
print $response;
What did I do there? I used qq with the delimiters | to store the entire response in $response, which will allow you to use the form variables to customize the message (look at your form input, I guessed at 'first_name'.) Then we print it out as one block. You know how to do HTML, you can customise everything between the || to customize your response. Just be wary of any delimiters within the text block, for example, if you do
<a href="about/html">About</a> | <a href="/">Home</a>
It will end the block early and error. Escape it.
<a href="about/html">About</a> \| <a href="/">Home</a>
I have the same problem with the lines that give people error messages, etc...
As mentioned, this is a BAD way to do the send-to. We'd have to see a lot more of the script to solve it.
While it's true there are many prepackaged and likely better scripts available, this is how you learn, by picking one apart and experimenting, keep at it. It will start to soak in.