Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Contact Form - Popup confirmation
Old 08-23-2008, 04:31 PM Contact Form - Popup confirmation
staaadesigns's Avatar
Skilled Talker

Posts: 77
Trades: 0
So i'm creating a simple PHP / HTML contact form, you know the very generic coding ones. Well I was looking into it more and since my pages on my site open in a main body DIV, I wanted a contact form that, once submitted, will pop up a warning box that simply says "thank you, message received", etc...rather than redirecting to a new thankyou.html page. [that would work fine, but i cant get that thankyou.html page to open in the main DIV, because i dont know how to implement ajax in php....]

So... any help or code on either of those problems would be greatly appreciated. Thanks!
__________________

Please login or register to view this content. Registration is FREE
staaadesigns is offline
Reply With Quote
View Public Profile Visit staaadesigns's homepage!
 
 
Register now for full access!
Old 08-23-2008, 05:13 PM Re: Contact Form - Popup confirmation
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
Why don't you just have the contact form POSTING to itself and use a conditional to replace the form with a thankyou.

PHP Code:
<?php if(!$_POST){ 
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>
method="post">
First Name:
<br />
<input type="text" name="firstName">
<br />
Last Name:
<br />
<input type="text" name="lastName">
<br />
Message
<br />
<textarea name="message" cols="20" rows="6"></textarea>
<br /><br />
<input type="submit" name="submit" value="Send">
</form>
<?php } else {

// email script

echo "Thanks, message received"
}
?>
maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Contact Form - Popup confirmation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.79607 seconds with 12 queries