How to stop my html pages hanging after a cgi script

After filling in a form on my siteaubmitting it and havoing the from details displayed to theuser, there is no further action bythe server.

How do I get it to go back to the referring url ?
WHat statement do I add to the form ?
Who is Participating?
archaic0Connect With a Mentor Commented:
If your host is using the standard formmail script, then you can add this to your form:

<input type="hidden" name="redirect" value="url">

and it will send the user to "url" after submitting the form.
Javascript is your best bet, simply print the string

print qq!<a href="javascript:history.go(-1)">GO BACK</a>!;

When the user clicks on the link it will take them to the referring page.
astollerAuthor Commented:
Could we have it take them back to the referring page without them having to click on the link?
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

astollerAuthor Commented:
The javascript statement.
Does it go into the perl script ?
What happens is
Form is filled in and submitted.
Then we get a page showing details entered, generated by the perl script.
So do I put the new line into the perl script ?
Yes put the following code into the perl script, it will automatically take the user back to the previous page, they will not need to click a link.

print "<script>history.go(-1);</script>";

I think it would be better to tell the user that the form has submitted successfully and they can click a link to go back to the previous page ?

Hope this helps!
Of course, at that url you put a page that thanks them for their input and provides them links to go on from there.
All Courses

From novice to tech pro — start learning today.