/    Sign up×
Community /Pin to ProfileBookmark

Forms submissions

Please help. I have designed a basic form and the on-click function of the SUBMIT button is to send the form to an email address – this works.

At the same time I want to bring up a confirmation.htm page.
I can manage to get either one event or the other to happen, but not both at the same time! Is this possible? How! Any assistance would be appreciated.

Thanks,
Rivanta

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@the_treeJun 13.2005 — If you used a server-side process (with PHP or JSP or suchlike) then this would be easilly achiveable and a lot more reliable as well as accessable.
Copy linkTweet thisAlerts:
@The_Magus2Jun 14.2005 — Dear Rivanta:

A year or so ago someone on this site pointed me to someplace where I found something similiar to the following to which I made a few alterations and saved as "mailer.php" and uploaded to my site.

<?PHP

#######################################################

# This script is Copyright 2003, Infinity Web Design #


# Distributed by http://www.webdevfaqs.com #


# Written by Ryan Brill - [email][email protected][/email] #


# All Rights Reserved - Do not remove this notice #


#######################################################

## The lines below need to be edited...



###################### Set up the following variables ######################

#


$to = "[email protected]"; #set address to send form to

$subject = "Results from your Request Info form"; #set the subject line

$headers = "From: [email][email protected][/email]"; #set the from address, or any other headers

$forward = 1; # redirect? 1 : yes || 0 : no

$location = "Thank_you.htm"; #set page to redirect to, if 1 is above

#


##################### No need to edit below this line ######################

## set up the time ##



$date = date ("l, F jS, Y");

$time = date ("h:i A");

## mail the message ##



$msg = "Below is the result of your feedback form. It was submitted on $date at $time.nn";

if ($_SERVER['REQUEST_METHOD'] == "POST") {

foreach ($_
POST as $key => $value) {

$msg .= ucfirst ($key) ." : ". $value . "n";

}

}

else {

foreach ($_GET as $key => $value) {

$msg .= ucfirst ($key) ." : ". $value . "n";

}

}

mail($to, $subject, $msg, $headers);

if ($forward == 1) {

header ("Location:$location");

}

else {

echo "Thank you for submitting our form. We will get back to you as soon as possible.";

}

?>

As you can see I had to type in my web address and make a file "thank_you.htm" which contained the message I wanted.

This seems to send the message to my e-mail client and to display a thank you page.

You might have a look at the site: www.allaboutmarmaris.com to see how it works - of course you will have to find one of the forms and send me a message to see the results - look for a contact link at the bottom of the pages.

Trust this helps and it is a pleasure to finally find a question that I can assist with - even in a small way.

Cheers

Jack
×

Success!

Help @Rivanta spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...