Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect after form processing 1

Status
Not open for further replies.

FurryGorilla

Technical User
Joined
Apr 11, 2001
Messages
76
Location
GB
Hi

I've only just started getting to grips with Perl and am having a small problem. I have a simple feedback form which passes the name, e-mail address, date, department and questions of the user who submits the form.

However, I currently have it writing a simple HTML page when the user submits but I would prefer it to go directly to a web page.

The code I currently have to write the web page is as follows but is there a simple way to change this to redirect the browser:

............
print MESSAGE "$FORM{department}\n\n";
print MESSAGE "$FORM{feedback}\n";

close (MESSAGE);
# Thank the user and acknowledge
# the feedback
&thank_you;
}

.....

sub thank_you {

print "Content-type: text/html\n\n";
print &quot;<HTML>\n&quot;;
print &quot;<HEAD>\n&quot;;
print &quot;<TITLE>Thank You!</TITLE>\n&quot;;
print &quot;</HEAD>\n&quot;;
print &quot;<BODY BGCOLOR=#FFFFFF TEXT=#000000>\n&quot;;
print &quot;<H1>Thank You!</H1>\n&quot;;
print &quot;\n&quot;;
print &quot;<P>\n&quot;;
print &quot;<H3>Your feedback is greatly appreciated.<BR>\n&quot;;
print &quot;Click here to <A HREF=link.htm>Back</A>.\n&quot;;
print &quot;<P>\n&quot;;
print &quot;</BODY>\n&quot;;
print &quot;</HTML>\n&quot;;
exit(0);
}

Thanks in advance
Chris
 
Just print a location header:
Code:
print &quot;Location: [URL unfurl="true"]http://www.somewhere.com/somepage.html\n\n&quot;;[/URL]
Make sure you have TWO \n at the end, and don't print anything else before.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks Tracy

Greatly appreciated.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top