php thank you page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

php thank you page

Post by obi_wasabi »

at the following url
working.ckimedia.com/contact.php

I've a form with JS validation, I want to generate a custom thank you page that use the name, e-mail, and comments as a receipt. "Thank you $name @ $email you commented: $comments. A reply will arrive shortly."

I don't want to change the form too much as the JS validation was a hefty lesson?
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

what specifically are you having a problem with?

the logic is something very basic like this


Code: Select all

if (all fields complete) {
    // send email, then
    echo "
<p>thank you for your email, $name ( $email )<br>
your email was sent as follows:</p>
<div>$comments</div>
";
}

you may want to look at nl2br()
youll prob want to use that on the $comments



btw- very nice design.
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

php thank you page

Post by obi_wasabi »

Hi,

My problem with my newbie understanding is implementing the script. Does it need be on the thank you page, if not how does one implement it in the current contact page? Should I use a thank you pop-up window?

I have a strange learning curve, the site is served with all includes, the doctype is altered per user agent. However this simple thing gives me pause.


CK

PS
Thanks for your compliment on the design
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

Since you are using JS for the form validation, you could use document.write or window.open
whatever you want really.
Post Reply